You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michael Nicholson <ma...@email.unc.edu> on 2002/10/04 20:59:11 UTC

So, what does it take to register a JDBC driver for a connection pool?

Or is that even necessary?  (I would think it is...).  I've been trying to get the DBCP-commons going for a while, and finally got it to find the correct resource reference, but it still returns a null datasource.  So I started changing things in the server.xml to find out what doesn't cause my result to change, with the idea that maybe that's where my error is.  So I can change my driverClassName to anything and get the exact same result, so my current theory is that this is where the problem is.  My partial server.xml file is below:

<Resource name="jdbc/myoracle" auth="Container" type="javax.sql.DataSource" /> 

          <ResourceParams name="jdbc/myoracle">
            <parameter>
              <name>driverClassName</name>
              <value>oracle.jdbc.driver.OracleDriver</value>
            </parameter>
            <parameter>
              <name>driverName</name>
              <value>jdbc:oracle:thin:@oraclehost.com:1521:ORDB</value>
            </parameter>
            <parameter>
              <name>username</name>
              <value>wahwah</value>
            </parameter>
            <parameter>
              <name>password</name>
              <value>joebillybob</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>  

RE: So, what does it take to register a JDBC driver for a connection pool?

Posted by Miguel Angel Mulero Martinez <mi...@mad.tecsidel.es>.
To use the jakarta dbcp you must use the factory parameter. My example (it
works perfectly):

   <ResourceParams name="jdbc/dbpool">
      <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:@hostvinci:1521:ceei</value>
      </parameter>
      <parameter>
        <name>username</name>
        <value>europa</value>
      </parameter>
      <parameter>
        <name>password</name>
        <value>europa</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>

-----Mensaje original-----
De: Michael Nicholson [mailto:man@email.unc.edu]
Enviado el: viernes, 04 de octubre de 2002 20:59
Para: Tomcat Users List
Asunto: So, what does it take to register a JDBC driver for a connection
pool?

Or is that even necessary?  (I would think it is...).  I've been trying
to get the DBCP-commons going for a while, and finally got it to find
the correct resource reference, but it still returns a null datasource.
So I started changing things in the server.xml to find out what doesn't
cause my result to change, with the idea that maybe that's where my
error is.  So I can change my driverClassName to anything and get the
exact same result, so my current theory is that this is where the
problem is.  My partial server.xml file is below:

<Resource name="jdbc/myoracle" auth="Container"
type="javax.sql.DataSource" />

          <ResourceParams name="jdbc/myoracle">
            <parameter>
              <name>driverClassName</name>
              <value>oracle.jdbc.driver.OracleDriver</value>
            </parameter>
            <parameter>
              <name>driverName</name>
              <value>jdbc:oracle:thin:@oraclehost.com:1521:ORDB</value>
            </parameter>
            <parameter>
              <name>username</name>
              <value>wahwah</value>
            </parameter>
            <parameter>
              <name>password</name>
              <value>joebillybob</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>


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