tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ed Sykes" <>
Subject Cannot create JDBC driver of class '' for connect URL 'null'
Date Mon, 15 Nov 2004 16:48:55 GMT


I'm trying to setup DBCP with Tomcat 5.5.4 with Oracle 8.1.6 using Java 1.5.0


I've read FAQ, and the Jakarta How-To Docs:


Everything works fine if I don't use connection pooling or JNDI lookups.




conn = DriverManager.getConnection(URL, USERNAME, PASSWORD);

stmt = conn.createStatement();


works fine.  So, Tomcat finds the Oracle JDBC driver fine.


I'm getting the following error:


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


Here's is the section I've added to C:\jakarta-tomcat-5.5.4\conf\server.xml


<Context path="/ROOT/WEB-INF/classes" docBase="ROOT/WEB-INF/classes/JITS"

        debug="5" reloadable="true" crossContext="true">


   <Resource name="jdbc/myoracle" auth="Container"

              type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver"


              username="jits" password="mypassword" maxActive="20" maxIdle="10"



<ResourceParams name="jdbc/myoracle">









































Here's the contents of C:\jakarta-tomcat-5.5.4\webapps\ROOT\WEB-INF\web.xml














 <description>Oracle Datasource example</description>








In my java file ( )  :



        Context initContext = new InitialContext();

        System.out.println("1 got an initial context from JNDI");


        Context envContext = (Context)initContext.lookup("java:/comp/env");

        System.out.println("2 got a context from JNDI");


        DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");

        System.out.println("3 got a datasource from JNDI");



        Connection conn = ds.getConnection();       

        System.out.println("4 got a connection from the pool");





1 got an initial context from JNDI

2 got a context from JNDI

3 got a datasource from JNDI

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

        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(

        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(

        at JITS.ImageServer.getImage(



Any suggestions would be gratefully appreciated !



Ed Sykes



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message