Unable to establish connection between R studio and Teradata

Connectivity

Unable to establish connection between R studio and Teradata

i am using Terdata version 13.10 and R Studio 3.2.3 (32-bit). I am trying to establish connection between both using following code. I also have all required JDBC drivers installed on system.

drv = JDBC("com.teradata.jdbc.TeraDriver","C:\Users\Public\Desktop\TeraJDBC__indep_indep.15.00.00.33\terajdbc4.jar;C:\Users\Public\Desktop\TeraJDBC__indep_indep.15.00.00.33\tdgssconfig.jar")

conn = dbConnect(drv,"jdbc:teradata://tddev","userid","password") 

GSSException: Failure unspecified at GSS-API level (Mechanism level: UserFile parameter null)

at com.teradata.tdgss.jtdgss.TdgssParseXml.<init>(TdgssParseXml.java:81)

at com.teradata.tdgss.jtdgss.TdgssConfigApi.<init>(TdgssConfigApi.java:81)

at com.teradata.tdgss.jtdgss.TdgssConfigApi.<clinit>(TdgssConfigApi.java:44)

at com.teradata.tdgss.jtdgss.TdgssManager.<init>(TdgssManager.java:40)

at com.teradata.tdgss.jtdgss.TdgssManager.<clinit>(TdgssManager.java:29)

at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getTDgssVersion(GenericTeraEncrypt.java:640)

at com.teradata.jdbc.jdbc_4.parcel.ClientConfigParcel.toStream(ClientConfigParcel.java:54)

at com.teradata.jdbc.jdbc_4.io.TDPacket.addParcel(TDPacket.java:98)

at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:94)

at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:207)

at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.<init>(JDK6_SQL_Connection.java:35)

at com.teradata.jdbc.jdk6.JDK6ConnectionFactory.constructSQLConnection(JDK6ConnectionFactory.java:25)

at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:179)

at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:169)

at com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:234)

at com.teradata.jdbc.TeraDriver.connect(TeraDriver.java:160)

at java.sql.DriverManager.getConnection(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

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

  java.lang.NoClassDefFoundError: Could not initialize class com.teradata.tdgss.jtdgss.TdgssManager

Please suggest the solution

4 REPLIES
Teradata Employee

Re: Unable to establish connection between R studio and Teradata

That exception is due to tdgssconfig.jar not being accessible on the classpath, as discussed in the Troubleshooting section of the Teradata JDBC Driver User Guide.

http://developer.teradata.com/doc/connectivity/jdbc/reference/current/jdbcug_chapter_5.html#CHDIJJJH

In your code snippet, you listed tdgssconfig.jar in the second argument of the JDBC function. That's good.

But is the tdgssconfig.jar file actually located in the directory that you specified? And are the operating system permissions set on the tdgssconfig.jar file so that the R program can access the file?

Re: Unable to establish connection between R studio and Teradata

 tdgssconfig.jar  is located in the directory that i have specified in the code. Also, i checked that all permissions are granted on  tdgssconfig.jar  file so that R can access it. but i still get following error while running follwoing code:

drv = JDBC("com.teradata.jdbc.TeraDriver","C:\Users\ Public\Desktop\TeraJDBC__indep_indep.15.00.00.33\ terajdbc4.jar;C:\Users\Public\Desktop\ TeraJDBC__indep_indep.15.00.00.33\tdgssconfig.jar")

conn = dbConnect(drv,"jdbc:teradata://tddev","userid"," password") 

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

  java.lang.NoClassDefFoundError: Could not initialize class com.teradata.tdgss.jtdgss.TdgssManager

Also, i forgot to mention earlier that when 1st time i tried establishing connection, i was able to. But next time after closing down R session, when i re-opened and re-ran above mentioned code i started getting error.

Please help!

 

Teradata Employee

Re: Unable to establish connection between R studio and Teradata

If you're a Teradata customer, please open a customer service incident.

Re: Unable to establish connection between R studio and Teradata

There are some extra space characters in your jar file paths:

\Desktop\ TeraJDB

There is a white space character before 'Tera'

Please see if this caused the problem.