File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Cannot create JDBC driver of class '' for connect URL 'null' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Cannot create JDBC driver of class Watch "Cannot create JDBC driver of class New topic
Author

Cannot create JDBC driver of class '' for connect URL 'null'

sanjay yadav yadav
Greenhorn

Joined: May 05, 2008
Posts: 9
Hi all,
I am using JNDI in tomcat to cannect with database. when i execute the application, i am getting Exception like

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'

at the line 1

Context initContext = new InitialContext();
Context envCtx = (Context) initContext.lookup("java:comp/env");
DataSource ds = (DataSource)envCtx.lookup("jdbc/WareHouse");
if(ds!=null){
System.out.println("3333");
con = ds.getConnection(); //1
}

Please help.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

sanjay yadav yadav wrote:org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'

Problem with the JNDI binding, the problem with "driver" class name and db URL, please check if the are not EMPTY, also googling will yields more results,
Meanwhile How you're binding DB resource (JNDI code) ?

[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot create JDBC driver of class '' for connect URL 'null'