wood burning stoves 2.0*
The moose likes JDBC and the fly likes JDBC driver,Tomcat,DB2 Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC driver,Tomcat,DB2 Problem" Watch "JDBC driver,Tomcat,DB2 Problem" New topic
Author

JDBC driver,Tomcat,DB2 Problem

J You
Greenhorn

Joined: Jul 31, 2001
Posts: 29
Hi,I am trying to access DB2 with JDBC driver in the
tomcat3.3 server.Following is the code:
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
conn = DriverManager.getConnection(
"jdbc:db2:BankDB",userid,passwd);
I also include the db2java.zip in the CLASSPATH.
When I run a simple java application with above code
to test the database access,it works.But when I
use it in a servlet from Tomcat,I got the
ClassNotFoundException Error.It seems the server can
not get the driver.
I checked old posts in JavaRanch and still can not
get a clear solution.I also ran the usejdbc2.bat in
DB2.
Any advice?
Do I need to install the DB2 client in the machine?
Right now the DB2 server,Tomcat server and all programs
are in the same Win2000 box.
Thanks
Po-yu Chien
Ranch Hand

Joined: Nov 01, 2001
Posts: 45
In order to let Tomcat know your jdbc driver,
you have to put it in the lib directory of $TOMCAT_HOME
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC driver,Tomcat,DB2 Problem