Skip to Content.
Sympa Menu

freetds - [freetds] Connecting to DB2 Database through JDBC

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Sharma Deepak" <Deepak_Sharma02 AT infosys.com>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Connecting to DB2 Database through JDBC
  • Date: Tue, 3 Feb 2004 14:23:29 +0530

Hi,

I am trying to connect to an remote DB2 database. I am using the
following sample code snippet to do so:


private static Connection openConnection (String jdbcUrl, String
user,
String pwd) throws ClassNotFoundException, SQLException {
Connection conn = null;
// Register the JDBC driver
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
conn = DriverManager.getConnection(jdbcUrl, user, pwd);
return conn;
}



When I try to connect from my local development machine, everything
goes fine. However when I use the same code on a remote Unix box, I get
the error:
java.sql.SQLException: No suitable driver

I have put the same version of db2java.zip that I am using on my
development machine, in the classpath while executing the code. Also the
user id, password and jdbc urls are fine and works on my local
development machine.

The offshore development machine is running windows 2000 while Onsite
is an AIX box. Can the reason be incompatibilities in the db2java.zip
for windows and Unix/AIX. If yes, can you please send me the location of
db2java.zip for AIX.

Please let me know if some one else has encountered such a problem and
what can be the solution for it. Any pointer will be appreciated.

Thanks and Regards
Deepak





Archive powered by MHonArc 2.6.24.

Top of Page