Friday, April 22, 2016

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

Leave a Comment

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

1 Answers

Answers 1

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.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment