JDBC works fine but RJDBC fails

Connectivity
Enthusiast

JDBC works fine but RJDBC fails

Hi,

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 14.00.00.21] [Error 1032] [SQLState HY000] Single Sign-On NOT supported for Mechanism TD2.

Found a thread talking about this error but from WebSphere:

http://forums.teradata.com/forum/database/error-while-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 ?

2 REPLIES
Senior Supporter

Re: JDBC works fine but RJDBC fails

you need to specify

terajdbc4.jar

and tdgssconfig.jar in the ClassPath

check

http://forums.teradata.com/forum/analytics/connecting-to-teradata-in-r-via-the-teradatar-package

Enthusiast

Re: JDBC works fine but RJDBC fails

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 <- td.data.frame("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

Regards

Sree