• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
sanjay yadav yadav
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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) ?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic