• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connect to db2 problem

 
michael yue
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to connect tomcat server to db2.
try{
Class.forName("com.ibm.db2.jcc.DB2Driver");
}
catch(ClassNotFoundException cnfexcep) {
System.out.println("class not found:"+cnfexcep);
return null;
}

try {
cnt = DriverManager.getConnection("jdbc b2:mydb", "db2inst1", "password");
}

I have already put the db2jcc.jar in the common/lib and the web-inf/lib directory. I got the following error.

Class.forName("com.ibm.db2.jcc.DB2Driver");
sqlexcep:com.ibm.db2.jcc.b.SQLException: Unable to load T2 native library. Type 2 JDBC architecture is not yet supported by the IBM DB2 JDBC Universal Driver Architecture

I have also try with
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
Class.forName("COM.ibm.db2.jdbc.net.DB2Driver");
and both end up with error: no suitable driver found

Anybody face this problem before? any help is appreciated. Thanks
 
Carl Wilburn
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sounds like you need a different driver. i'm not an expert here, but you could try going to this url: http://servlet.java.sun.com/products/jdbc/drivers
and search for an IBM/DB2/Type4 driver and give it a shot.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic