All Forums Connectivity
sreevaddi 9 posts Joined 07/12
07 Nov 2012
JDBC works fine but RJDBC fails

I have successfully connected to teradata from standalone java application using jdbc.
But fails to establish connection using RJDBC.

RStudio v0.96 (R v2.15.1)

JDBC v14.00.00.21

JDK v1.7.0_09

Mac v10.7.4
> library(RJDBC)
> jdrv <- JDBC(driverClass="com.teradata.jdbc.TeraDriver", classPath="~/mydrivers/td/terajdbc4.jar:~/mydrivers/ td/tdgssconfig.jar")
> conn <- dbConnect(jdrv,"jdbc:teradata://TDServer/ TMODE=ANSI,CHARSET=UTF8,uid=tduser,pwd=passwd")
Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1],  :
  com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC] [Error 1032] [SQLState HY000] Single Sign-On NOT supported for Mechanism TD2.
Found a thread talking about this error but from WebSphere: trying-to-connect-to-teradata
This thread suggests to update TD Gateway. If it is the Gateway settings, how would we explain Standalone Java-JDBC Application was successful, connecting to TD ?
Any explanation would help me make a good case with my TD Admins to change the Gateway setting.
This thread also suggests to check the connection string.  Same exact connection string works, again, in Standalone Java-JDBC Application ?
What is RJDBC doing different than JDBC using the same drivers ?
Has anyone had any success connecting from R to TeraData using RJDBC ?

ulrich 816 posts Joined 09/09
07 Nov 2012

you need to specify

and tdgssconfig.jar in the ClassPath

feel free to donate bitcoin:12kgAUHFUqvG2sQgaRBXFhCwyf9HXdkGud

sreevaddi 9 posts Joined 07/12
08 Nov 2012

Hi Ulrich,
This worked perfect. Thank you very much.

> library(RJDBC)
> .jaddClassPath("~/mydrivers/td/terajdbc4.jar")
> .jaddClassPath("~/mydrivers/td/tdgssconfig.jar")
> library(teradataR)
> tdConnect("mytd", "tduser", "passwd", "sys_calendar", "jdbc")
> tdf <-"calendar")
> my.stats <- td.stats(tdf,"year_of_calendar", c("cnt","min","max","mean"))
> my.stats
               col  xcnt xmin xmax xmean
1 year_of_calendar 73414 1900 2100  2000



You must sign in to leave a comment.