Hello,

I have an easy question about using JNDI in tomcat 5

I am using the example @
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-resources-howto.html

Below is my server.xml entry

Here is what I do not quite understand.

In this little bit of code do I have to do anything to use the pooling

When I do a conn.close, does that actually close the db connection, or does
it just release it to the pool

Thanks

Sorry if this is an obvious question

Randy


Context initCtx = new InitialContext();
DataSource ds = (DataSource)envCtx.lookup("java:comp/env/jdbc/UnitNet");

Connection conn = ds.getConnection();
... use this connection to access the database ...
conn.close();

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

            <ResourceParams name="jdbc/Unit">
              <parameter>
                <name>factory</name>
 
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
              </parameter>

              <parameter>
                <name>maxActive</name>
                <value>10</value>
              </parameter>

              <parameter>
                <name>maxIdle</name>
                <value>5</value>
              </parameter>

              <parameter>
                <name>maxWait</name>
                <value>10000</value>
              </parameter>

              <parameter>
               <name>username</name>
               <value>aaaaaaa</value>
              </parameter>
              <parameter>
               <name>password</name>
               <value>xxxxxxx</value>
              </parameter>

              <parameter>
                 <name>driverClassName</name>
                 <value>org.gjt.mm.mysql.Driver</value>
              </parameter>

              <parameter>
                <name>url</name>
 
<value>jdbc:mysql://marge.sss.com:3306/unit?autoReconnect=true</value>
              </parameter>

            <parameter>
              <name>removeAbandoned</name>
              <value>true</value>
            </parameter>

            <parameter>
              <name>removeAbandonedTimeout</name>
              <value>60</value>
            </parameter>

            <parameter>
              <name>logAbandoned</name>
              <value>false</value>
            </parameter>

      </ResourceParams>

#===========================================================================
================



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to