wood burning stoves 2.0*
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
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:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception while connectiing DB through Tomcat