DriverManager.getConnection() method error while using Teradatd driver

Connectivity
Enthusiast

DriverManager.getConnection() method error while using Teradatd driver


hi ,

I am new to Teradata. I am trying to connect to Teradata DB using teradata driver. i am getting Error in DriverManager.getConnection() Method. I am not able to understand why this is comming. I have tried with the latest driver avaliable in net for teradata.

String url="jdbc:teradata:///AMRROCD"
Class.forName("com.teradata.jdbc.TeraDriver");
Properties x = new Properties();
x.put("user","xxxx");
x.put("password","xxxx");
Connection con = DriverManager.getConnection (url, x);--> I am getting Null Pointer Exception at this line .

could anyone help me. I am trying to run this code in Unix environment

I am able to execute the same code through windows OS.

i have set classpath for terajdbc4.jar

Thanks in Advance

1 REPLY
Teradata Employee

Re: DriverManager.getConnection() method error while using Teradatd driver

First, your connection URL is incorrect. You listed 3 slashes in your URL -- jdbc:teradata:///AMRROCD

But you must have only 2 slashes after the second colon in your URL -- it should be jdbc:teradata://AMRROCD

Second, you said "i have set classpath for terajdbc4.jar", but you need tdgssconfig.jar on your classpath also.

You didn't provide the stack trace for your NullPointerException, but if your NullPointerException is occurring at com.teradata.tdgss.jtdgss.TdgssConfigApi.GetMechanisms , then that problem is due to due to tdgssconfig.jar not being available -- either not listed on your classpath, or the file is not present.