Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 09 Jul 2014 @ 14:41:35 GMT


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  


Subj:   Teradata JDBC connection issue
 
From:   Koushik Chandra

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.(TDNetworkIOIF.java:132)
             at com.teradata.jdbc.jdbc_4.TDSession.getIO(TDSession.java:571)
             at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:97)
             at com.teradata.jdbc.jdbc_4.TDSession.(TDSession.java:219)
             at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.(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:232)
             at com.teradata.jdbc.TeraDriver.connect(TeraDriver.java:158)
             at java.sql.DriverManager.getConnection(Unknown Source)
             at java.sql.DriverManager.getConnection(Unknown Source)
             at TeradataJDBC.main(TeradataJDBC.java:23)
             Caused by: 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)

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



     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023