You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by abhishek srivastava <ab...@hotmail.com> on 2002/06/09 17:07:25 UTC

Help Connection pooling doesn't work for me

Hello All,

Sorry for the previous half typed mail... IE just decided to send the mail 
on its own.

I make the following call in my Java code
DataSource ds  = (javax.sql.DataSource) 
initCtx.lookup("java:comp/env/jdbc/DBSource");
return ds.getConnection(); // RETURNS NULL

Here the ds.getConnection() is returning me null. I have been thru the jndi 
manual and this list archive... but I just can't get this.

I also tried the same code on weblogic and it worked perfectly.

Please help me ... below is the entries which I have made in verious config 
files. Please poing the mistake in this because I am just lost here.

server.xml
-------------
<Resource name="jdbc/DBSource" auth="CONTAINER" 
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/DBSource">
  <parameter><name>user</name><value>myuser</value></parameter>
  <parameter><name>password</name><value>mypwd</value></parameter>
  <parameter>
    <name>driverClassName</name>
    <value>oracle.jdbc.driver.OracleDriver</value>
  </parameter>
  <parameter>
    <name>driverName</name>
    <value>jdbc:oracle:thin:@localhost:1521:AAA</value>
  </parameter>
</ResourceParams>

web.xml
----------
<resource-ref>
  <res-ref-name>jdbc/DBSource</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
  <res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>

regards,
Abhishek.





_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>