File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Exception while connectiing DB through Tomcat 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 » Databases » JDBC
Bookmark "Exception while connectiing DB through Tomcat" Watch "Exception while connectiing DB through Tomcat" New topic
Author

Exception while connectiing DB through Tomcat

santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'


Dear all

Im connectio my SQL DB to my application through JNDI but im getting error as the above

Here is my Server.XML file


And my Web.Xml


And in my code


Please tell me the way to com out of this exception


Creativity is nothing but Breaking Rules
Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
What is the tomcat version you are using? If tomcat 6, you may want to look here: https://sec1.woopra.com/docs/jndi-datasource-examples-howto.html
Additionally I do not see the db name mentioned in the jdbc url in your code.


Thanks and Regards
Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
Here's a configuration that worked for me:

1.Create context.xml as follows:


2.Copy context.xml to META-INF folder of the WAR
3.Have the following code in servlet:
 
jQuery in Action, 2nd edition
 
subject: Exception while connectiing DB through Tomcat
 
Similar Threads
JDBC-CONNECTION POOL
datasource???
javax.naming.NamingException- Cannot create resource instance
connection pooling problem
problem in getting sybase Datasource in Tomcat 4.1.12