my dog learned polymorphism*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet accessing database problem" Watch "servlet accessing database problem" New topic
Author

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: http://aspose.com/file-tools
 
subject: servlet accessing database problem
 
Similar Threads
problem in adding a new row for the user input data
Thread problem in Servlet
Optimizing Database Connection ?
Spring ApplicationContext loading no Servlet Context
printing using servlet