3

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

brno792
  • 6,479
  • 17
  • 54
  • 71
  • maybe that's a typo between two paths to driver files, there is a colon `:` in your question, but there must be semicolon `;` – inscaven Apr 19 '16 at 05:51
  • agree with @inscaven, i do not get an "class not found" error when i use `drv = JDBC("com.teradata.jdbc.TeraDriver", "terajdbc4.jar;tdgssconfig.jar")` – chinsoon12 Apr 20 '16 at 04:56
  • I'm on a Mac, so I need a colon rather than a semi-colon. I did try semi-colon too however and still get the same error. – brno792 Apr 21 '16 at 18:24
  • on a side note, I am not sure why people choose the wrong tool to do things. – zinking Apr 22 '16 at 15:10

2 Answers2

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.

etrippler
  • 91
  • 1
  • 7
0

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.

Mithilesh Kumar
  • 256
  • 1
  • 3
  • 18