Category: Data Sources

Connecting R to Oracle Database

No Comments

The following three packages are required to connect to Oracle Database:

  1. DBI
  2. rJava
  3. RJDBC
    The  next steps:
    1. Need appropriate Oracle JDBC Drivers compatible with the Java version you like to support.
    2. To connect to the source database you need the following: Hostname or IP, Port, Service name or SID, Username, Password
    3. Use the information from Number 2 to construct a Data Source Name or DSN in the format:


    Now, execute the following steps to connect to the database:

# Create connection driver
jdbcDriver = JDBC(driverClass="oracle.jdbc.OracleDriver",

#Open connection
jdbcConn = dbConnect(jdbcDriver,"",

#Close connection
Categories: Data Sources Tags: Tags: , ,