The moose likes Tomcat and the fly likes connect to db2 problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "connect to db2 problem" Watch "connect to db2 problem" New topic

connect to db2 problem

michael yue
Ranch Hand

Joined: Nov 20, 2003
Posts: 204

I am trying to connect tomcat server to db2.
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(""); 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
and both end up with error: no suitable driver found

Anybody face this problem before? any help is appreciated. Thanks
Carl Wilburn

Joined: Jun 17, 2004
Posts: 9
sounds like you need a different driver. i'm not an expert here, but you could try going to this url:
and search for an IBM/DB2/Type4 driver and give it a shot.

Live, learn and do!
I agree. Here's the link:
subject: connect to db2 problem
It's not a secret anymore!