Hi Vincent.

I had the same issue - try changing the "driverName" parameter to "url" - it helped me.

pete.

-----Original Message-----
From: Vincent Lambert [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 2:55 AM
To: 'Tomcat Users List'
Subject: JDBC-JNDI connection pooling


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

 
Thanks for help...
 
Regards,
Vincent

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

Reply via email to