Bookmark Topic Watch Topic
  • New Topic

JDBC driver,Tomcat,DB2 Problem  RSS feed

 
J You
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't post in multiple forums.
This has been answered in the JDBC forum.
Dave.
 
zpan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Report post to moderator

Try saving .zip file as .jar file then run again.See what happens.
Pan
Originally posted by David O'Meara:
Please don't post in multiple forums.
This has been answered in the JDBC forum.
Dave.

 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Not to mention the Tomcat/Apache forum.
http://www.javaranch.com/ubb/Forum56/HTML/000044.html
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!