This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC driver,Tomcat,DB2 Problem" Watch "JDBC driver,Tomcat,DB2 Problem" New topic

JDBC driver,Tomcat,DB2 Problem

J You

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:
conn = DriverManager.getConnection(
I also include the 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
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.
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:
subject: JDBC driver,Tomcat,DB2 Problem
It's not a secret anymore!