Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Android Security Essentials Live Lessons this week in the Android 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]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Cannot create JDBC driver of class '' for connect URL 'null'
 
Similar Threads
Tomcat's Datasource
Can't get connection from DataSource object
JNDI Connection Pool Problem
struts 1.3 Data base connection pool
Connecting to database in Tomcat 5.5