brno792
brno792

Reputation: 6799

Error Creating DBI Driver to Start JDBC Connection to Teradata From R

I was successfully connecting to Teradata from R with the following code:

library(DBI)
library(rJava)
library(RJDBC)
library(teradataR)

drv = JDBC("com.teradata.jdbc.TeraDriver","/Users/me/R_repos/TeraJDBC_indep_indep.14.10.00.26/terajdbc4.jar:/Users/me/R_repos/TeraJDBC_indep_indep.14.10.00.26/tdgssconfig.jar")

However it has suddenly stopped working. I now get this error message when I run the above JDBC function:

Error in .jfindClass(as.character(driverClass)[1]) : class not found

I have not changed the directory path or the jar files in any way.

When I run .jclassPath() I see my RJDBC jar and JAVA jar loading correctly:

[1] "/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rJava/java"           "/Library/Frameworks/R.framework/Versions/3.2/Resources/library/RJDBC/java/RJDBC.jar"

Nothing else has changed except that I have restarted my R session several times and also installed the Caret package recently as well. I cannot understand why this is failing.

I'm running R version 3.2.2 on Mac iOS 10.10.5

Upvotes: 3

Views: 526

Answers (2)

Mithilesh Kumar
Mithilesh Kumar

Reputation: 263

Download Teradata JDBC drivers from here:

https://downloads.teradata.com/download/connectivity/jdbc-driver

jars=['/CorrectPath/tdgssconfig.jar','/CorrectPAth/terajdbc4.jar']

Unpack and give the new path for jar files. It should work.

Upvotes: 0

etrippler
etrippler

Reputation: 91

Is it possible that your JVM version has changed? One of the most common reasons for this error is JVM mismatch. At any rate, run

.jclassLoader()$setDebug(1L)

to see the actual reason it's failing.

And run

("java.lang.System")$getProperty("java.version")

to check your JVM version.

Upvotes: 1

Related Questions