|
Archives of the TeradataForumMessage Posted: Wed, 09 Jul 2014 @ 14:41:35 GMT
Hi, I am trying to connect to Teradata database using JDBC driver, but connection is not getting established, Can some one please help. I have written the below Java code. /*********************** Java Code ***********************/ import java.sql.*; public class TeradataJDBC { public static void main(String[] args) throws Exception { try { System.out.println("Stage-1"); String driver = "com.teradata.jdbc.TeraDriver"; System.out.println("Stage-2"); String conUrl = "jdbc:teradata://xx.xxx.xx.xx/DATABASE=xxxxxxxx/TMODE=ANSI,CHARSET=UTF8,USER=xxxxx,PASSWORD=xxxxx"; System.out.println("Stage-3"); Class.forName(driver); System.out.println("conUrl ::" + conUrl); Connection dbConn = DriverManager.getConnection(conUrl); System.out.println("Stage-5"); System.out.println("Connected"); } catch (ClassNotFoundException e) { e.printStackTrace(); } } While executing the above code I am getting the below error and unable to connect to database. /***********************Error***********************/ C:\MyDir>java -classpath .;terajdbc4.jar;tdgssconfig.jar TeradataJDBC Stage-1 Stage-2 Stage-3 conUrl ::jdbc:teradata://xx.xxx.xx.xx/DATABASE=xxxxx/TMODE=ANSI,CHARSET=UTF8,COMPAT _DBS=true,USER=xxxxx,PASSWORD=xxxxx 2014-07-09.18:14:01.162 TERAJDBC4 ERROR [main] com.teradata.jdbc.jdk6.JDK6_SQL_Connection@5716647b Connection to xx.xxx.xx.xx Wed Jul 09 18:14:01 IST 2014 socket orig=xx.xxx.xx.xx cid=1d95b5ad sess=0 java.net.SocketTimeoutException: connect timed out at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF$ConnectThread.run(TDNetworkIOIF.ja va:1214) Exception in thread "main" com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC 15.00.00.15] [Error 1277] [SQLState 08S01] Login timeout for Connection to xx.xxx.xx.xx Wed Jul 09 18:14:01 IST 2014 socket orig=xx.xxx.xx.xx cid=1d95b5ad sess=0 java.net.SocketTimeoutException: connect timed out at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) at java.net.AbstractPlainSocketImpl.connect(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF$ConnectThread.run(TDNetworkIOIF.java:1214) at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:93) at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:68) at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeIoJDBCException(ErrorFactory.java:206) at com.teradata.jdbc.jdbc_4.util.ErrorAnalyzer.analyzeIoError(ErrorAnalyzer.java:61) at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.createSocketConnection(TDNetworkIOIF.java:153) at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF. Please find below the Teradata Driver version which I am using. /***********************Driver Version***********************/ Manifest-Version: 1.0 Specification-Title: JDBC Data Access API Created-By: 1.4.2_14 (Sun Microsystems Inc.) Implementation-Title: Teradata JDBC Driver Specification-Vendor: Sun Microsystems, Inc. Specification-Version: 4.0 Implementation-Version: 15.00.00.15 Name: com/teradata/jdbc Implementation-Vendor: Teradata Corporation Regards, Koushik Chandra
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||