Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Gimme a hand pahdner!!!

 
Krish Pat
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to connect to a DB2 on a AS400 from Windows2000 professional system using a small JSP code on Tomcat4.0.1. This is the error I get...
Exception:
javax.servlet.ServletException: COM.ibm.db2.jdbc.app.DB2Driver
**blah blah blah**
Root cause:
java.lang.ClassNotFoundException: COM.ibm.db2.jdbc.app.DB2Driver
**blah blah blah**
I fetched the db2_classes.jar file from the AS400 and defined it in the CLASSPATH.But to no avail. Do I have to use some other JDBC drivers? I would appreciate any assistance in this context...
Thanks
 
sim sim
Ranch Hand
Posts: 55
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Krish,
The exception says that it can not find the class 'COM.ibm.db2.jdbc.app.DB2Driver'.
Try unjaring the jar file to some temp directory and see if that class is present in the jar file.
I dont know if this is correct approach but just give it a try.
Regards,
Sim Sim
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The name of the JDBC zip file for DB2 is '<SOME_PATH>/SQLLIB/java/db2java.zip'
Rene
[ August 02, 2002: Message edited by: Rene Larsen ]
 
Krish Pat
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank u people for the suggestions. I extracted the zip file and moved the class files under COM/ibm to the CLASSES sub-directory of Tomcat and that eradicated the error message. Now the error message I have is
exception
javax.servlet.ServletException: No suitable driver
---blah blah blah---
root cause
java.sql.SQLException: No suitable driver
---blah blah blah---
In the jsp page I am using "Class.forName("COM.ibm.db2.jdbc.app.DB2Driver"); to load the driver, is this the way to register the driver also OR is there any other way?
Once again,sincere thanks to Sim Sim and Rene Larsen.
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you put the classes under '<SOME_WEBAPP>/WEB_INF/classes'?
you could also put the jar/zip file in the directory '<SOME_WEBAPP>/WEB_INF/lib' you just have to remember that the extention must be jar.
Rene
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Krish P",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp.
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements.
Thanks.
Dave
 
Krish Pat
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have put the requisite classes in and I still get the error. I have also checked for the correct URL syntax that I pass to Driver.getConnection. I cant think of any other areas. The JSP code I am using is pretty simple and straightforward. Any suggestions?
Thanks yet again to Rene Larsen...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic