aspose file tools*
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
Author

connect to db2 problem

michael yue
Ranch Hand

Joined: Nov 20, 2003
Posts: 204
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

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: http://servlet.java.sun.com/products/jdbc/drivers
and search for an IBM/DB2/Type4 driver and give it a shot.


Live, learn and do!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connect to db2 problem
 
Similar Threads
No suitable Driver - DB2 error
JDBC-DB2 connectivity issue
Doubt on Hibernate application
Not able to connect to db2 from java
Problem in connecting to DB2 using JDBC