I am trying to establish a connection to my database using an R package called
I am trying the below code
connectionDetails <- DatabaseConnector::createConnectionDetails(dbms = "postgresql", user = "xxx", password = "xxx", server = "localhost/xxx", port = "9763")
When I execute the above command, I get the below error
Error: The folder location pathToDriver = ' ' does not exist. Please set the folder to the location containing the JDBC driver. You can download most drivers using the `downloadJdbcDrivers()` function.
But till few days back, it was working fine and there was no issue with any driver location. I didn’t make any changes to the driver’s location etc. Not sure why this issue is being raised now. Can I seek your help, please?
Therefore, I tried the below options.
a) I downloaded the jar file and keyed in the downloaded location as a path in the
pathToDriver argument of the
ConnectionDetails function as shown below. However, this doesn’t solve the issue
pathToDriver = "C:\\Users\\test\\Downloads\\postgresql-42.2.19.jar")
b) I set an environment variable as suggested in the doc here. So, I have an environment variable as suggested which is
DATABASECONNECTOR_JAR_FOLDER. This points to the jar file that I downloaded (Postgresql-42.2.19.jar)
I get the below error as well
Error in download.file(url = paste0(baseUrl, driverName), destfile = paste(pathToDriver, : cannot open destfile 'C:\Users\test\Downloads\postgresql-42.2.19.jar/postgresqlV42.2.18.zip', reason 'No such file or directory' In addition: Warning messages: 1: The folder location 'C:\Users\test\Downloads\postgresql-42.2.19.jar' does not exist. Attempting to create. 2: In dir.create(pathToDriver, recursive = TRUE) : 'C:\Users\test\Downloads\postgresql-42.2.19.jar' already exists
c) Later, I tried using the
downloadJdbcDrivers() function with
pathToDriver updated to my jar file location but it still doesn’t resolve the issue
Can I seek your help please?