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 Servlets and the fly likes servlet accessing database 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 » Java » Servlets
Bookmark "servlet accessing database problem" Watch "servlet accessing database problem" New topic

servlet accessing database problem

Luther Adon
Ranch Hand

Joined: Apr 27, 2002
Posts: 51
I am trying to access a mckoi database using tomcat through a servlet. At this point it seems to be failing just on the JDBCDriver getting a classnotfoundexception.
This is quite odd as it is not a simple pathing problem as my old accessing a database through an application programs work fine. Even more odd the error file comes as a type called "file" called ShowDeptServlet or ShowDeptServleta4bc9243 with a screen of errors that start with the aforementioned one and then org.apache.catalina.* many errors.
Not sure what to do at this point, help!
P.S. If you have Instant Java Servlets by Phil Hanna it is on page 84.
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

system CLASSPATH (which your plain app uses) is not the same as the CLASSPATH in use by Tomcat 4.x. So in fact, it could be a simple path issue.

Do you have your database drivers in the application's WEB-INF/lib directory? Or in Tomcat's common/lib directory? Try both of those.
Luther Adon
Ranch Hand

Joined: Apr 27, 2002
Posts: 51
Thanks muchly for the assistance. I fixed the classpath and the placement and it works better.
[ August 21, 2002: Message edited by: Luther Adon ]
I agree. Here's the link:
subject: servlet accessing database problem
It's not a secret anymore!