Hello Vincent,

Did you ever figure out your problem with this?  I am also getting
null with pretty much the same configuration as you, except I am using
"url" instead of "driverName".

I am also using Tomcat-4.1-dev (one of the nightly builds that uses
DBCP rather than Tyrex.

Anyway, if you find anything, can you send the solution my way?  I'll
do the same from this end.

thanks,

Jake

Tuesday, April 23, 2002, 4:55:14 AM, you wrote:

VL> I am trying to use database connection pooling with Tomcat 4.0.3 through
VL> JNDI (jdk 1.4).
VL> I am using MySQL database with mm.mysql driver v 2.0.12.
 
VL> Context initCtx       = new InitialContext();
VL> Context envCtx        = (Context) initCtx.lookup("java:comp/env");
VL> DataSource w_ds       = (DataSource) envCtx.lookup("jdbc/ds");
 
VL> With this code inserted into a servlet or a JSP, I am getting a NULL
VL> DataSource !
 
 
VL> Here is a piece of my configuration files:
VL> server.xml:
VL> <Resource name="jdbc/ds" auth="Container" type="javax.sql.DataSource"/>
VL> <ResourceParams name="jdbc/ds">
VL>     <parameter>
VL>         <name>driverClassName</name>
VL>         <value>org.gjt.mm.mysql.Driver</value>
VL>     </parameter>
VL>     <parameter>
VL>         <name>driverName</name>
VL>         <value>jdbc:mysql://localhost/test</value>
VL>     </parameter>
VL>     <parameter>
VL>         <name>user</name>
VL>         <value>youruser</value>
VL>     </parameter>
VL>     <parameter>
VL>         <name>password</name>
VL>         <value>yourpasswd</value>
VL>     </parameter>
VL> </ResourceParams>
 
VL> web.xml:
VL> <resource-ref>
VL>     <description>
VL>         Resource reference to a factory for javax.sql.Datasource
VL>     </description>
VL>     <res-ref-name>jdbc/ds</res-ref-name>
VL>     <res-type>javax.sql.DataSource</res-type>
VL>     <res-auth>Container</res-auth>
VL> </resource-ref>

 
VL> Thanks for help...
 
VL> Regards,
VL> Vincent



-- 
Best regards,
 Vincent                            mailto:[EMAIL PROTECTED]


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to