I'm trying to migrate some inherited scripts that use RJDBC
to connect to an Oracle database to use the odbc
package instead. I've reviewed the https://db.rstudio.com docs and tried a number of configurations but haven't been able to connect. I'm in uncharted territory within my org, so haven't been able to get much help internally.
Essentially, all I have is RJDBC code (like below) that successfully connects me to the database. How can I use this information, or information that I can query from the DB, to set up or diagnose my odbc
connection? Or, more generally, what steps do I need to take to get from here to odbc
?
library(RJDBC)
drv <- JDBC("oracle.jdbc.OracleDriver", classPath="instantclient_12_2/ojdbc8.jar")
con <- dbConnect(drv,"jdbc:oracle:thin:@server-ip:1521:database",
rstudioapi::askForSecret("Username"),
rstudioapi::askForSecret("Database Password"))