aspose file tools*
The moose likes JDBC and the fly likes about database connectivity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "about database connectivity" Watch "about database connectivity" New topic
Author

about database connectivity

phani bhushan reddy
Greenhorn

Joined: Jul 20, 2007
Posts: 27

I am having problem when i was try to connect the database, while using servlets. It was throwing an exception called ClassNotFoundException, actually i know the meaning of the exception but it was working when i am doing simple applications and also in the swing applications but it was making problem when it comes to servlets only, please tell me the solution for this
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42916
    
  68
You didn't mention which class was not found -the exception should tell you that- but I'm guessing that it is the JDBC driver. Did you put the jar file that contains the driver into the WEB-INF/lib directory of your web application?
mohan kumar r
Ranch Hand

Joined: Jan 19, 2006
Posts: 38
you can also add jar in CLASSPATH entry of the server you are using.
for example,if you are using weblogic server and Oracel DB,
add classes12.jar to CLASSPATH entry in driver:\bea\user_projects\domains\mydomain\startManagedWebLogic.cmd(or .sh if it is in unix).
restart the server
deploy the application


mohan
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Tomcat ignores the CLASSPATH environment variable.
You might want to check this for more information related to Tomcat's classloading hierarchy.

As Ulf said , you have to put the driver classes jar in WEB-INF/lib folder.


Rahul Bhattacharjee
LinkedIn - Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: about database connectivity