All Forums Connectivity
Uwe.Bombosch 1 post Joined 09/13
28 Aug 2015
Connecting from R via RJDBC and terajdbc4.jar fails

My company is running an R-Studio Server Pro on a Red Hat Linix 6 platform (64bit) and a Teradata 14 RDBMS. When trying to connect via RJDBC, I get an error that seems to be well known in the forums, but the standard recipes for resolving the issues don't help. Here is how I connect to the Teradata DB:


tdConnect("jdbc:teradata://<DSN>/ CHARSET=UTF8,TMODE=TERA,SESSIONS=1","<user>","<pwd>"," <table>","jdbc")

drv = JDBC("com.teradata.jdbc.TeraDriver", classPath = "<path>/terajdbc4.jar:<path>/tdgssconfig.jar", identifier.quote = "'")

con = dbConnect(drv=drv,"jdbc:teradata://<DSN>/ CHARSET=UTF8,TMODE=TERA,SESSIONS=1", "<user>", "<pwd")

ret = dbGetQuery(con, "sel * from <table>")

The tdConnect results in an error message: Error in .jfindClass(as.character(driverClass)[1]) : class not found

whereas the dbConnect is a bit more verbose:

Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1], :

java.lang.NoClassDefFoundError: com.teradata.tdgss.jtdgss.TdgssManager
I have searched the forums, and found several posts on such an error (e.g. connecting-to-teradata-in-r-via-the-teradatar-package) , but they all relate to the standard fault that the tdgssconfig.jar is missing from the classpath.
As you can see, this is not my case. The jars are in the proper place, and the Java class TdgssManager is present in the terajdbc4.jar. The R-function .classPath() also list them properly.
Some background information:

  • I tried all versions of the terajdbc4, and the most recent one is what I'm currently using: TeraJDBC__indep_indep.
  • We have quite an old Java version (1.5) installed on our server, but according to the documentation of terajdbc4, that should be fine
  • I have downloaded the most recent versions of rJava, DBI, teradataR, and RJDBC  (0.9.7, 0.3.1, 1.0.1, and 0.2.5, respectively)
  • The same code works nicely, when I'm running it on my Windows 7 32 bit company laptop

Can you please give me a hint what still could be wrong?

ulrich 816 posts Joined 09/09
20 Oct 2015

Hi Uwe,
can you try to run the two classpath statements two times. I get sometimes the missing classpath message also. But usually it disapears after I run the class path statements a second time.
also I am using a different connection for the tdConnect






tdf <-"calendar")
my.stats <- td.stats(tdf,"year_of_calendar", c("cnt","min","max","mean"))

the system is the dsn name found in /etc/hosts not the full jdbc connection string.
I tested this with teradata studio and Teradata R15.0
I don't have R studio server available...
Just to revalidate - the classpath is refering the server path to the jdbc driver, not the local client path. correct?
Kind regards

feel free to donate bitcoin:12kgAUHFUqvG2sQgaRBXFhCwyf9HXdkGud

skunkwerk2 2 posts Joined 08/15
16 Nov 2015

I'm having the exact same problem, and adding the .jaddClassPath's twice does not help.
I'm using RJDBC 0.2-5, Teradata driver 15, and Java 1.6 on Ubuntu linux.
I do not want to use teradataR, as it is no longer supported.

ulrich 816 posts Joined 09/09
18 Nov 2015

can you share your code you are using?

feel free to donate bitcoin:12kgAUHFUqvG2sQgaRBXFhCwyf9HXdkGud

You must sign in to leave a comment.