All Forums Database
25 Jun 2008
Connecting Teradata from Java

Please send me examples/code snippets you may have used to achieve Teradata database connectivity from Java.

ywjcjj 36 posts Joined 06/08
26 Jun 2008

Down load the Teradata JDBC driver from Teradate website... then1. set up connection private void buildCon() { try { Class.forName("com.ncr.teradata.TeraDriver"); con = DriverManager.getConnection(serverURL, username, password); } catch (Exception e) { e.printStackTrace(); } }2. create statement and execute query Statement st = con.createStatement(); ResultSet rs = null; String sql = "........"; rs = st.executequery(sql); .....deal with your resultset.....3. close connection private void closeCon(){ if(con != null){ try { this.con.close(); } catch (SQLException e) { e.printStackTrace(); } } }

sylvesterdsouza 3 posts Joined 07/08
13 Aug 2008

Hey Ivy,I am having a problem with the connection string.I am using the connection string:jdbc:teradata://HostName/DATABASE=databaseNamei am facing a problem in the time it takes to connect.The database is in a different network and also in US and i am trying to connect to it from India.Also i have to be in the US network and then this connection string works.Is there a connection string which will allow me to connect to the us network from India.Also Is there a JDBC Driver that will enhance the connectivity speed?Thanks in advance,Sylvester

You must sign in to leave a comment.