• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Gimme a hand pahdner!!!

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic