Unable to connect to Teradta Express 13 via JDBC

Connectivity

Unable to connect to Teradta Express 13 via JDBC

Hi,

I just installed Teradata Express 13 VMWare instance. Everything installed and works fine, except I am unable to connect to the dbc database via a Teradata 13 JDBC driver. The URL supplied is:  "jdbc:teradata://localhost/DBS_PORT=1025,DATABASE=dbc,CHARSET=UTF8".

Please advise?

Thanks... Vince

12 REPLIES
Teradata Employee

Re: Unable to connect to Teradta Express 13 via JDBC

What exception are you getting?

Re: Unable to connect to Teradta Express 13 via JDBC

Hi,

Yes... forgot the details... :)

I am using the JDBC jar file: terajdbc4.jar and on of the two driver entry points in the file: com.teradata.jdbc.TeraDriver version: 13.10.00.31.

The connection string is similar either specifying localhost or the VM's IP dependening if I am local (on the same VM using SQuirreL) or remote, Below is the available stack trace from SQuirreL:

java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NullPointerException

 at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)

 at java.util.concurrent.FutureTask.get(Unknown Source)

 at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.awaitConnection(OpenConnectionCommand.java:132)

 at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$100(OpenConnectionCommand.java:45)

 at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$2.run(OpenConnectionCommand.java:115)

 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

 at java.util.concurrent.FutureTask.run(Unknown Source)

 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

 at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.RuntimeException: java.lang.NullPointerException

 at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:175)

 at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.access$000(OpenConnectionCommand.java:45)

 at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand$1.run(OpenConnectionCommand.java:104)

 ... 6 more

Caused by: java.lang.NullPointerException

 at com.teradata.tdgss.jtdgss.TdgssConfigApi.GetMechanisms(Unknown Source)

 at com.teradata.tdgss.jtdgss.TdgssManager.<init>(Unknown Source)

 at com.teradata.tdgss.jtdgss.TdgssManager.getInstance(Unknown Source)

 at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getGSSM(GenericTeraEncrypt.java:623)

 at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getConfig(GenericTeraEncrypt.java:641)

 at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getUserNameForOid(GenericTeraEncrypt.java:734)

 at com.teradata.jdbc.AuthMechanism.<init>(AuthMechanism.java:50)

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

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

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

 at com.teradata.jdbc.jdk6.JDK6ConnectionFactory.constructConnection(JDK6ConnectionFactory.java:22)

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

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

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

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

 at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133)

 at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.executeConnect(OpenConnectionCommand.java:167)

 ... 8 more

And the stack trace from DB Visualizer:

An error occurred while establishing the connection:

Details:

   Type: java.lang.NullPointerException

Stack Trace:

java.lang.NullPointerException

   at com.teradata.tdgss.jtdgss.TdgssConfigApi.GetMechanisms(Unknown Source)

   at com.teradata.tdgss.jtdgss.TdgssManager.<init>(Unknown Source)

   at com.teradata.tdgss.jtdgss.TdgssManager.getInstance(Unknown Source)

   at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getGSSM(GenericTeraEncrypt.java:623)

   at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getConfig(GenericTeraEncrypt.java:641)

   at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getUserNameForOid(GenericTeraEncrypt.java:734)

   at com.teradata.jdbc.AuthMechanism.<init>(AuthMechanism.java:50)

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

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

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

   at com.teradata.jdbc.jdk6.JDK6ConnectionFactory.constructConnection(JDK6ConnectionFactory.java:22)

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

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

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

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

   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

   at java.lang.reflect.Method.invoke(Unknown Source)

   at com.onseven.dbvis.g.B.D.ā(Z:1413)

   at com.onseven.dbvis.g.B.F$A.call(Z:1474)

   at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

   at java.util.concurrent.FutureTask.run(Unknown Source)

   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

   at java.lang.Thread.run(Unknown Source)

Thx... Vince

Teradata Employee

Re: Unable to connect to Teradta Express 13 via JDBC

You are getting java.lang.NullPointerException at com.teradata.tdgss.jtdgss.TdgssConfigApi.GetMechanisms ...

We talk about this problem in the Troubleshooting section of the Teradata JDBC Driver User Guide, available here on Developer Exchange:

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

In short, you get that exception when tdgssconfig.jar is not available on your classpath, or not accessible due to permission restrictions.

You need both terajdbc4.jar and tdgssconfig.jar listed on your classpath.

Re: Unable to connect to Teradta Express 13 via JDBC

That was it. I am too biased by single JDBC Type-4 driver Jar files...

Thank you very much for your timely assistance!  

N/A

Re: Unable to connect to Teradta Express 13 via JDBC

Hi Tomnolan,

Exacetely i am also getting same issue..Can you please help me on this ?.

Error log is :

16-Oct-2013 09:57:01IST Unable to create a connection using the jdbc:teradata://10.65.142.204/DATABASE=rts_dev,TMODE=ANSI,CHARSET=UTF16 URL with dbc username because of the following error: [Teradata JDBC Driver] [TeraJDBC 1

16-Oct-2013 09:57:01IST 4.00.00.00] [Error 1000] [SQLState 08S01] Login failure for Packet receive Wed Oct 16 09:57:01 IST 2013 socket orig=10.65.142.204 local=0.0.0.0/0.0.0.0:33409 remote=/10.65.142.204:1025 keepalive=unava

16-Oct-2013 09:57:01IST ilable nodelay=unavailable receive=unavailable send=unavailable linger=unavailable traffic=unavailable concurrent=3 contimeout=10000 conwait=1000 connecttime=6 connecttotaltime=8 connectattempts=1 con

16-Oct-2013 09:57:01IST nectfailures=0 failurecache={} cid=10fd7411 sess=20662 java.io.IOException: Incomplete LAN message header: read 0 bytes at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.read(TDNetworkIOIF.java:659) at c

16-Oct-2013 09:57:01IST om.teradata.jdbc.jdbc_4.io.TDPacketStream.readStream(TDPacketStream.java:818) at com.teradata.jdbc.jdbc.GenericEncryptContextState.action(GenericEncryptContextState.java:119) at com.teradata.jdbc.jd

16-Oct-2013 09:57:01IST bc.GenericLogonController.run(GenericLogonController.java:120) at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:212) at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.<init>(JDK6_SQL_Connecti

16-Oct-2013 09:57:01IST on.java:30) at com.teradata.jdbc.jdk6.JDK6ConnectionFactory.constructConnection(JDK6ConnectionFactory.java:22) at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:130

16-Oct-2013 09:57:01IST ) at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:120) at com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:220) at com.teradata.jdbc.TeraDriver.connect(Ter

16-Oct-2013 09:57:01IST aDriver.java:153) at java.sql.DriverManager.getConnection(DriverManager.java:579) at java.sql.DriverManager.getConnection(DriverManager.java:221) at com.applimation.jdbc.JdbcTemplateFactory$AMDataS

16-Oct-2013 09:57:01IST ource.createConnection(JdbcTemplateFactory.java:620) at com.applimation.jdbc.JdbcTemplateFactory$AMDataSource.getConnection(JdbcTemplateFactory.java:611) at com.applimation.jdbc.JdbcTemplateFactory.

16-Oct-2013 09:57:01IST createJdbcTemplate(JdbcTemplateFactory.java:421) at com.applimation.jdbc.JdbcTemplateFactory.createJdbcTemplate(JdbcTemplateFactory.java:487) at com.applimation.jdbc.JdbcTemplateFactory.getJdbcTempl

16-Oct-2013 09:57:01IST ateForStaging(JdbcTemplateFactory.java:515) at com.applimation.archive.dao.impl.AbstractArchiveEngineDAOImpl.getJdbcTemplateForStaging(AbstractArchiveEngineDAOImpl.java:244) at com.applimation.archi

16-Oct-2013 09:57:01IST ve.dao.impl.InsertIntoDestinationTableDAOImpl.copyTableToDestination(InsertIntoDestinationTableDAOImpl.java:167) at com.applimation.archive.services.thread.CopyToDestinationThread.run(CopyToDestinati

16-Oct-2013 09:57:01IST onThread.java:130) at com.applimation.services.thread.AMThreadQueueManager$AMThreadQueueElement.run(AMThreadQueueManager.java:503) at java.lang.Thread.run(Thread.java:722)

16-Oct-2013 09:57:01IST com.applimation.jdbc.JdbcTemplateFactory.createJdbcTemplate(JdbcTemplateFactory.java:446)

16-Oct-2013 09:57:01IST com.applimation.jdbc.JdbcTemplateFactory.createJdbcTemplate(JdbcTemplateFactory.java:487)

16-Oct-2013 09:57:01IST com.applimation.jdbc.JdbcTemplateFactory.getJdbcTemplateForStaging(JdbcTemplateFactory.java:515)

16-Oct-2013 09:57:01IST com.applimation.archive.dao.impl.AbstractArchiveEngineDAOImpl.getJdbcTemplateForStaging(AbstractArchiveEngineDAOImpl.java:244)

16-Oct-2013 09:57:01IST com.applimation.archive.dao.impl.InsertIntoDestinationTableDAOImpl.copyTableToDestination(InsertIntoDestinationTableDAOImpl.java:167)

16-Oct-2013 09:57:01IST com.applimation.archive.services.thread.CopyToDestinationThread.run(CopyToDestinationThread.java:130)

16-Oct-2013 09:57:01IST com.applimation.services.thread.AMThreadQueueManager$AMThreadQueueElement.run(AMThreadQueueManager.java:503)

16-Oct-2013 09:57:01IST java.lang.Thread.run(Thread.java:722)

Any idea or can you please let me know what is the issue on this ? either Driver issue ?  N/w Issue ?  oR Teradata DB Issue ?  

Plesae let me know what is the exactely issue here ?

Teradata Employee

Re: Unable to connect to Teradta Express 13 via JDBC

Are you running your program on Linux? If the "Incomplete LAN message header: read 0 bytes" error occurs when running on a Linux machine,

then the most likely cause is the "Slow Logon on Linux" problem.

The problem, and workarounds, are documented in the Teradata JDBC Driver User Guide here on Developer Exchange:

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

Teradata Employee

Re: Unable to connect to Teradta Express 13 via JDBC

I am facing a similar problem too. I am connected to the Aster Database located in San Carlos, CA.  I am using Teradata Studio as the client application.  I don't have any problem to connect to the database “toysrus” and see all the tables that I need.  My problem is that I can't perform any SQL command... I get the error message "java.lang.NullPointerException".  Base on the information provided the problem should be resolved if I add an environment variable "classpath" pointing to the files "terajdbc4.jar" and "terajdbc4.jar".   I have done this but still I have the same issue.  Where should I look for these files to make sure that I have them? Thanks you for any help.

Teradata Employee

Re: Unable to connect to Teradta Express 13 via JDBC

Marco, you probably have a different problem that the one discussed in this forum thread. The Teradata JDBC Driver is used to connect to the Teradata Database, not the Aster Database.

You must use the Aster JDBC Driver to connect to the Aster Database. Teradata Studio 14.10.01 (the latest release) includes the Aster JDBC Driver version 5.10.

N/A

Re: Unable to connect to Teradta Express 13 via JDBC

Hi Tomnolan,

JDBC application is running on windows.And Teradata Database is running on Linux  AND WINDOWS.Can you please help me on this ?