The following three packages are required to connect to Oracle Database:
- 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:
library(RJDBC) # Create connection driver jdbcDriver = JDBC(driverClass="oracle.jdbc.OracleDriver", classPath="lib/classes12.jar") #Open connection jdbcConn = dbConnect(jdbcDriver,"jdbc:oracle:thin:@database.hostname.com:port:sid", "username","password") #Close connection dbDisconnect(jdbcConn)