I have
Tomcat 5.5.23 and the following in my
server.xml
----------
<Resource name="jdbc/mytest"
auth="Container"
type="org.apache.commons.dbcp.BasicDataSource"
maxActive="16"
maxWait="2000"
username="scott"
password="tiger" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@localhost:1521:pbz01"
/>
web.xml
-------
<resource-ref>
<res-ref-name>
jdbc/mytest
</res-ref-name>
<res-type>
javax.sql.DataSource
</res-type>
<res-auth>
Container
</res-auth>
</resource-ref>
and here's the error I get when I do this..
Context envCtx = (Context) new InitialContext().lookup("java:comp/env");
DataSource ds = (DataSource) envCtx.lookup("jdbc/mytest");
return ds.getConnection();
Error
------
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
JDBC driver of class '' for connect URL 'null'
Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)