commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Verbeeck <dirk.verbe...@pandora.be>
Subject Re: [DBCP]: Exception resulting from a null URL
Date Sun, 19 Sep 2004 20:28:34 GMT
Hi

I don't see a obvious configuration problem, but there is one because 
DBCP doesn't get the driver & url properties.

To debug this please doanload and run showJNDI.jsp from
http://cvs.apache.org/~dirkv/builds/

Cheers
Dirk

Hassan Ahsan Ali wrote:

> hi
> 
> i am using tomcat 5.5.1 and oracle8i, i want to confgure DBCP for 
> connection pooling.
> 
> my server.xml file is as under:
> 
> <Context path="/abc"
>     docBase="abc"
>     debug="0">
> 
>   <Logger className="org.apache.catalina.logger.FileLogger"
>       prefix="localhost_abc_log." suffix=".txt"
>       timestamp="true"/>
> 
>  <Resource name="jdbc/myoracle" auth="Container"
>              type="javax.sql.DataSource" scope="Shareable"/>
>  <ResourceParams name="jdbc/myoracle">
>  <parameter>
>    <name>factory</name>
>    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>  </parameter>
>  <parameter>
>    <name>driverClassName</name>
>    <value>oracle.jdbc.driver.OracleDriver</value>
>  </parameter>
>  <parameter>
>    <name>url</name>
>    <value>jdbc:oracle:thin:@dbser.mynet.net:1533:db</value>
>  </parameter>
>  <parameter>
>    <name>username</name>
>    <value>scott</value>
>  </parameter>
>  <parameter>
>    <name>password</name>
>    <value>tiger</value>
>  </parameter>
>  <parameter>
>    <name>maxActive</name>
>    <value>20</value>
>  </parameter>
>  <parameter>
>    <name>maxIdle</name>
>    <value>10</value>
>  </parameter>
>  <parameter>
>    <name>maxWait</name>
>    <value>-1</value>
>  </parameter>
> </ResourceParams>
> </Context>
> 
> and web.xml is :
> 
> <resource-ref>
> <description>Database resource </description>
> <res-ref-name>jdbc/myoracle</res-ref-name>
> <res-type>javax.sql.DataSource</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
> 
> 
> and my jsp is :
> 
> <%@ page language="java"
> import="javax.naming.*,javax.sql.*,java.sql.*,java.util.*,org.apache.commons.dbcp.*,java.io.*"%>

> 
> 
> <%
> Statement stmt = null ;
> Connection conn = null ;
> ResultSet rset = null ;
> Context initContext = null ;
> Context envContext = null ;
> DataSource ds = null;
> 
> initContext = new InitialContext();
> envContext  = (Context)initContext.lookup("java:/comp/env");
> ds = (DataSource)envContext.lookup("jdbc/myoracle");
> out.println (ds);
> 
> conn = ds.getConnection();
> stmt = conn.createStatement ();
> ........................................
> 
> 
> now i have placed my classes12.jar file ( which i copied from 
> orahome\jdbc\lib\classes12.zip and renamed to .jar) in the 
> catalina_home\common\lib directory
> 
> when i execute the jsp i get the following exception
> 
> Error Occured: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot 
> create JDBC driver of class '' for connect URL 'null'
> 
> can any one help out in making the code work
> 
> thanx in advance
> 
> Hassan
> 
> _________________________________________________________________
> The new MSN 8: advanced junk mail protection and 2 months FREE* 
> http://join.msn.com/?page=features/junkmail
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message