jmcnally    02/05/26 12:07:31

  Modified:    .        build.xml
               src/rttest Torque.properties
               xdocs    jdbc2pool-howto.xml
  Added:       src/java/org/apache/torque/dsfactory
                        Jdbc2PoolDataSourceFactory.java
                        TorqueDataSourceFactory.java
  Log:
  added a couple more factories that are a bit simpler to configure,
  especially for standalone operation.
  
  Revision  Changes    Path
  1.48      +1 -0      jakarta-turbine-torque/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/build.xml,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- build.xml 21 May 2002 19:51:44 -0000      1.47
  +++ build.xml 26 May 2002 19:07:31 -0000      1.48
  @@ -23,6 +23,7 @@
       <pathelement location="${commons-configuration.jar}"/>
       <pathelement location="${commons-lang.jar}"/>
       <pathelement location="${commons-pool.jar}"/>
  +    <pathelement location="${commons-jdbc2pool.jar}"/>
       <pathelement location="${junit.jar}"/>
       <pathelement location="${stratum.jar}"/>
       <pathelement location="tdk.jar"/>
  
  
  
  1.1                  
jakarta-turbine-torque/src/java/org/apache/torque/dsfactory/Jdbc2PoolDataSourceFactory.java
  
  Index: Jdbc2PoolDataSourceFactory.java
  ===================================================================
  package org.apache.torque.dsfactory;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Turbine" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Turbine", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  import javax.sql.DataSource;
  import javax.sql.ConnectionPoolDataSource;
  
  import java.util.Iterator;
  import org.apache.commons.configuration.Configuration;
  import org.apache.torque.TorqueException;
  import org.apache.commons.jdbc2pool.Jdbc2PoolDataSource;
  import org.apache.commons.jdbc2pool.adapter.DriverAdapterCPDS;
  
  /**
   * A factory that looks up the DataSource from JNDI.  It is also able
   * to deploy the DataSource based on properties found in the 
   * configuration.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>John McNally</a>
   * @version $Id: Jdbc2PoolDataSourceFactory.java,v 1.1 2002/05/26 19:07:31 jmcnally 
Exp $
   */
  public class Jdbc2PoolDataSourceFactory 
      extends AbstractDataSourceFactory
      implements DataSourceFactory
  {
      private DataSource ds;
  
      /**
       *
       */
      public DataSource getDataSource()
      {
          return ds;
      }
  
      /**
       * initialize
       *
       * @throws TorqueException Any exceptions caught during processing will be
       *         rethrown wrapped into a TorqueException.
       */
      public void initialize(Configuration configuration) 
          throws TorqueException
      {
          if (configuration == null)
          {
              throw new TorqueException("Torque cannot be initialized without " +
                  "a valid configuration. Please check the log files " +
                      "for further details.");
          }        
          ConnectionPoolDataSource cpds = initCPDS(configuration);
          Jdbc2PoolDataSource ds = initJdbc2Pool(configuration);
          ds.setConnectionPoolDataSource(cpds);
          this.ds = ds;
      }
  
      private ConnectionPoolDataSource initCPDS(Configuration configuration)
          throws TorqueException
      {
          category.debug("Starting initCPDS"); 
          ConnectionPoolDataSource cpds = new DriverAdapterCPDS();
          Configuration c = configuration.subset("connection");
          try
          {
              Iterator i = c.getKeys();
              while (i.hasNext())
              {
                  String key = (String)i.next();
                  category.debug("Setting datasource property: " 
                                 + key);
                  setProperty(key, c, cpds);
              }
          }            
          catch (Exception e)
          {
              category.error("", e);
              throw new TorqueException(e);
          }
          return cpds;
      }
  
      private Jdbc2PoolDataSource 
          initJdbc2Pool(Configuration configuration)
          throws TorqueException
      {
          category.debug("Starting initTorqueClassic"); 
          Jdbc2PoolDataSource ds = new Jdbc2PoolDataSource();
          Configuration c = configuration.subset("pool");
          try
          {
              Iterator i = c.getKeys();
              while (i.hasNext())
              {
                  String key = (String)i.next();
                  category.debug("Setting datasource property: " 
                                 + key);
                  setProperty(key, c, ds);
              }
          }            
          catch (Exception e)
          {
              category.error("", e);
              throw new TorqueException(e);
          }
          return ds;
      }
  }
  
  
  
  1.1                  
jakarta-turbine-torque/src/java/org/apache/torque/dsfactory/TorqueDataSourceFactory.java
  
  Index: TorqueDataSourceFactory.java
  ===================================================================
  package org.apache.torque.dsfactory;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and
   *    "Apache Turbine" must not be used to endorse or promote products
   *    derived from this software without prior written permission. For
   *    written permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Turbine", nor may "Apache" appear in their name, without
   *    prior written permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  import javax.sql.DataSource;
  import javax.sql.ConnectionPoolDataSource;
  
  import java.util.Iterator;
  import org.apache.commons.configuration.Configuration;
  import org.apache.torque.TorqueException;
  import org.apache.commons.jdbc2pool.TorqueClassicDataSource;
  import org.apache.commons.jdbc2pool.adapter.DriverAdapterCPDS;
  
  /**
   * A factory that looks up the DataSource from JNDI.  It is also able
   * to deploy the DataSource based on properties found in the 
   * configuration.
   *
   * @author <a href="mailto:[EMAIL PROTECTED]";>John McNally</a>
   * @version $Id: TorqueDataSourceFactory.java,v 1.1 2002/05/26 19:07:31 jmcnally Exp 
$
   */
  public class TorqueDataSourceFactory 
      extends AbstractDataSourceFactory
      implements DataSourceFactory
  {
      private DataSource ds;
  
      /**
       *
       */
      public DataSource getDataSource()
      {
          return ds;
      }
  
      /**
       * initialize
       *
       * @throws TorqueException Any exceptions caught during processing will be
       *         rethrown wrapped into a TorqueException.
       */
      public void initialize(Configuration configuration) 
          throws TorqueException
      {
          if (configuration == null)
          {
              throw new TorqueException("Torque cannot be initialized without " +
                  "a valid configuration. Please check the log files " +
                      "for further details.");
          }        
          ConnectionPoolDataSource cpds = initCPDS(configuration);
          TorqueClassicDataSource tcds = initTorqueClassic(configuration);
          tcds.setConnectionPoolDataSource(cpds);
          ds = tcds;
      }
  
      private ConnectionPoolDataSource initCPDS(Configuration configuration)
          throws TorqueException
      {
          category.debug("Starting initCPDS"); 
          ConnectionPoolDataSource cpds = new DriverAdapterCPDS();
          Configuration c = configuration.subset("connection");
          try
          {
              Iterator i = c.getKeys();
              while (i.hasNext())
              {
                  String key = (String)i.next();
                  category.debug("Setting datasource property: " 
                                 + key);
                  setProperty(key, c, cpds);
              }
          }            
          catch (Exception e)
          {
              category.error("", e);
              throw new TorqueException(e);
          }
          return cpds;
      }
  
      private TorqueClassicDataSource 
          initTorqueClassic(Configuration configuration)
          throws TorqueException
      {
          category.debug("Starting initTorqueClassic"); 
          TorqueClassicDataSource ds = new TorqueClassicDataSource();
          Configuration c = configuration.subset("pool");
          try
          {
              Iterator i = c.getKeys();
              while (i.hasNext())
              {
                  String key = (String)i.next();
                  category.debug("Setting datasource property: " 
                                 + key);
                  setProperty(key, c, ds);
              }
          }            
          catch (Exception e)
          {
              category.error("", e);
              throw new TorqueException(e);
          }
          return ds;
      }
  }
  
  
  
  1.11      +43 -20    jakarta-turbine-torque/src/rttest/Torque.properties
  
  Index: Torque.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/rttest/Torque.properties,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Torque.properties 26 May 2002 04:30:10 -0000      1.10
  +++ Torque.properties 26 May 2002 19:07:31 -0000      1.11
  @@ -1,5 +1,5 @@
   # -------------------------------------------------------------------
  -# $Id: Torque.properties,v 1.10 2002/05/26 04:30:10 jmcnally Exp $
  +# $Id: Torque.properties,v 1.11 2002/05/26 19:07:31 jmcnally Exp $
   #
   # This is the configuration file for Torque.
   #
  @@ -47,27 +47,50 @@
   torque.database.default=bookstore
   torque.database.bookstore.adapter=mysql
   
  -torque.dsfactory.bookstore.factory=org.apache.torque.dsfactory.JndiDataSourceFactory
  -torque.dsfactory.bookstore.jndi.path=jdbc/bookstore
  -torque.dsfactory.bookstore.jndi.java.naming.factory.initial = 
org.apache.naming.java.javaURLContextFactory
  -torque.dsfactory.bookstore.jndi.java.naming.factory.url.pkgs = org.apache.naming
  -
  
-torque.dsfactory.bookstore.datasource.classname=org.apache.commons.jdbc2pool.TorqueClassicDataSource
  -torque.dsfactory.bookstore.datasource.dataSourceName=jdbc/DBbookstore
  -torque.dsfactory.bookstore.datasource.jndiEnvironment.java.naming.factory.initial = 
org.apache.naming.java.javaURLContextFactory
  -torque.dsfactory.bookstore.datasource.jndiEnvironment.java.naming.factory.url.pkgs 
= org.apache.naming
  -torque.dsfactory.bookstore.datasource.defaultMaxConnections=10
  +## Using torque's old pool
  
+#torque.dsfactory.bookstore.factory=org.apache.torque.dsfactory.TorqueDataSourceFactory
  +#torque.dsfactory.bookstore.pool.defaultMaxConnections=10
  +#torque.dsfactory.bookstore.pool.maxExpiryTime=3600
  +#torque.dsfactory.bookstore.pool.connectionWaitTimeout=10
  +#torque.dsfactory.bookstore.connection.driver = @DATABASE_DRIVER@
  +#torque.dsfactory.bookstore.connection.url = @DATABASE_URL@
  +#torque.dsfactory.bookstore.connection.user = @DATABASE_USER@
  +#torque.dsfactory.bookstore.connection.password = @DATABASE_PASSWORD@
  +
  +## Using Jdbc2Pool
  +torque.dsfactory.bookstore.factory=\
  +  org.apache.torque.dsfactory.Jdbc2PoolDataSourceFactory
  +torque.dsfactory.bookstore.pool.defaultMaxActive=10
  +torque.dsfactory.bookstore.pool.testOnBorrow=true
  +torque.dsfactory.bookstore.pool.validationQuery=SELECT 1
  +torque.dsfactory.bookstore.connection.driver = @DATABASE_DRIVER@
  +torque.dsfactory.bookstore.connection.url = @DATABASE_URL@
  +torque.dsfactory.bookstore.connection.user = @DATABASE_USER@
  +torque.dsfactory.bookstore.connection.password = @DATABASE_PASSWORD@
  +
  +
  +## Using jndi
  
+#torque.dsfactory.bookstore.factory=org.apache.torque.dsfactory.JndiDataSourceFactory
  +#torque.dsfactory.bookstore.jndi.path=jdbc/bookstore
  +#torque.dsfactory.bookstore.jndi.java.naming.factory.initial = 
org.apache.naming.java.javaURLContextFactory
  +#torque.dsfactory.bookstore.jndi.java.naming.factory.url.pkgs = org.apache.naming
  +
  
+#torque.dsfactory.bookstore.datasource.classname=org.apache.commons.jdbc2pool.TorqueClassicDataSource
  +#torque.dsfactory.bookstore.datasource.dataSourceName=jdbc/DBbookstore
  +#torque.dsfactory.bookstore.datasource.jndiEnvironment.java.naming.factory.initial 
= org.apache.naming.java.javaURLContextFactory
  +#torque.dsfactory.bookstore.datasource.jndiEnvironment.java.naming.factory.url.pkgs 
= org.apache.naming
  +#torque.dsfactory.bookstore.datasource.defaultMaxConnections=10
   
   ## ConnectionPoolDataSource
  
-torque.dsfactory.DBbookstore.factory=org.apache.torque.dsfactory.JndiDataSourceFactory
  -torque.dsfactory.DBbookstore.jndi.path=jdbc/DBbookstore
  -torque.dsfactory.DBbookstore.jndi.java.naming.factory.initial = 
org.apache.naming.java.javaURLContextFactory
  -torque.dsfactory.DBbookstore.jndi.java.naming.factory.url.pkgs = org.apache.naming
  
-torque.dsfactory.DBbookstore.datasource.classname=org.apache.commons.jdbc2pool.adapter.DriverAdapterCPDS
  -torque.dsfactory.DBbookstore.datasource.driver = @DATABASE_DRIVER@
  -torque.dsfactory.DBbookstore.datasource.url = @DATABASE_URL@
  -torque.dsfactory.DBbookstore.datasource.user = @DATABASE_USER@
  -torque.dsfactory.DBbookstore.datasource.password = @DATABASE_PASSWORD@
  
+#torque.dsfactory.DBbookstore.factory=org.apache.torque.dsfactory.JndiDataSourceFactory
  +#torque.dsfactory.DBbookstore.jndi.path=jdbc/DBbookstore
  +#torque.dsfactory.DBbookstore.jndi.java.naming.factory.initial = 
org.apache.naming.java.javaURLContextFactory
  +#torque.dsfactory.DBbookstore.jndi.java.naming.factory.url.pkgs = org.apache.naming
  
+#torque.dsfactory.DBbookstore.datasource.classname=org.apache.commons.jdbc2pool.adapter.DriverAdapterCPDS
  +#torque.dsfactory.DBbookstore.datasource.driver = @DATABASE_DRIVER@
  +#torque.dsfactory.DBbookstore.datasource.url = @DATABASE_URL@
  +#torque.dsfactory.DBbookstore.datasource.user = @DATABASE_USER@
  +#torque.dsfactory.DBbookstore.datasource.password = @DATABASE_PASSWORD@
   
   # Determines if the quantity column of the IDBroker's id_table should
   # be increased automatically if requests for ids reaches a high
  
  
  
  1.6       +100 -9    jakarta-turbine-torque/xdocs/jdbc2pool-howto.xml
  
  Index: jdbc2pool-howto.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/xdocs/jdbc2pool-howto.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jdbc2pool-howto.xml       26 May 2002 04:30:10 -0000      1.5
  +++ jdbc2pool-howto.xml       26 May 2002 19:07:31 -0000      1.6
  @@ -21,19 +21,21 @@
   <p>
   Starting with Torque-3.0b3, torque no longer includes a built-in pool.  
   Torque's old pool has been updated to be a <code>javax.sql.DataSource</code>
  -implementation and has been moved into the commons-sandbox/jdbc2pool package.
  +implementation and has been moved into the commons-jdbc2pool package within
  +the commons sandbox.
   Torque now expects a factory that can return a <code>DataSource</code> and can
   be configured using torque's configuration file.
   </p>
   
   <p>
  -Currently Torque provides a 
  -factory that uses jndi to retrieve the <code>DataSource</code>.  This factory 
  +Torque provides two special purpose factories as well as a general
  +factory that uses jndi to retrieve the <code>DataSource</code>.  The first
  +factory discussed below uses the updated version of torque's old pool and the
  +second uses the more full featured pool available in the same package.
  +The jndi factory looks up a <code>DataSource</code> bound to jndi; it
   also provides a simple property file based way to configure and deploy most
   <code>DataSource</code>'s, though in many cases a pool may already be 
  -bound to jndi and torque only needs to use it. It is expected that very soon
  -a couple more factories will be available to allow a simpler arrangement than
  -using jndi.
  +bound to jndi and torque only needs to use it.
   </p>
   
   <p>
  @@ -97,6 +99,95 @@
   
   </section>
   
  +
  +<section name="TorqueDataSourceFactory">
  +
  +<p>
  +This factory gives a DataSource version of the old built-in pool.  The old
  +pool was extracted and updated and is now part of the commons-jdbc2pool
  +package.  TorqueDataSourceFactory provides an easy way to configure this
  +pool and it assumes you will have a jdbc Driver class providing the physical
  +database connections.  First you must let torque know you are using this
  +factory.
  +</p>
  +
  +<source><![CDATA[
  
+torque.dsfactory.bookstore.factory=org.apache.torque.dsfactory.TorqueDataSourceFactory
  +]]></source>
  +
  +<p>
  +Then there are two sets of properties related to the pool configuration and 
  +settings for making the connection to the database.
  +</p>
  +
  +<source><![CDATA[
  +torque.dsfactory.bookstore.pool.defaultMaxConnections=10
  +torque.dsfactory.bookstore.pool.maxExpiryTime=3600
  +torque.dsfactory.bookstore.pool.connectionWaitTimeout=10
  +]]></source>
  +
  +<source><![CDATA[
  +torque.dsfactory.bookstore.connection.driver = org.gjt.mm.mysql.Driver
  +torque.dsfactory.bookstore.connection.url = jdbc:mysql://localhost:3306/bookstore
  +torque.dsfactory.bookstore.connection.user = root
  +torque.dsfactory.bookstore.connection.password = 1234
  +]]></source>
  +
  +<p>
  +The TorqueClassicDataSource used with this factory has a few other 
  +configuration options which could be set above in the "pool" section, but
  +the three shown are enough for most cases.  Please see the javadoc for the
  +class for more information.
  +</p>
  +
  +</section>
  +
  +<section name="Jdbc2PoolDataSourceFactory">
  +
  +<p>
  +This factory uses the more full featured DataSource available in the 
  +commons-jdbc2pool package.  Jdbc2PoolDataSourceFactory provides an easy way 
  +to configure this pool and it assumes you will have a jdbc Driver class 
  +providing the physical database connections.  Again, you must let torque know 
  +you are using this factory.
  +</p>
  +
  +<source><![CDATA[
  +torque.dsfactory.bookstore.factory= \
  +  org.apache.torque.dsfactory.Jdbc2PoolDataSourceFactory
  +]]></source>
  +
  +<p>
  +Then there are two sets of properties related to the pool configuration and 
  +settings for making the connection to the database.
  +</p>
  +
  +<source><![CDATA[
  +torque.dsfactory.bookstore.pool.defaultMaxActive=30
  +torque.dsfactory.bookstore.pool.testOnBorrow=true
  +torque.dsfactory.bookstore.pool.validationQuery=SELECT 1
  +]]></source>
  +
  +<source><![CDATA[
  +torque.dsfactory.bookstore.connection.driver = org.gjt.mm.mysql.Driver
  +torque.dsfactory.bookstore.connection.url = jdbc:mysql://localhost:3306/bookstore
  +torque.dsfactory.bookstore.connection.user = root
  +torque.dsfactory.bookstore.connection.password = 1234
  +]]></source>
  +
  +<p>
  +Comparing this with the torque's old pool, you can see that this pool does not
  +rely on expirying connections periodically to maintain their validity.  The
  +pool can be setup to test each connection before returning it to the 
  +application, so the likelihood of the application receiving a bad connection
  +is much smaller than using <code>TorqueClassicDataSource</code>.  
  +<code>Jdbc2PoolDataSource</code> contains several other options, for example,
  +the ability have several usernames sharing the same pool settings.  Please
  +see the commons-jdbc2pool javadoc for more info.
  +</p>
  +
  +</section>
  +
   <section name="JndiDataSourceFactory">
   
   <p>
  @@ -180,7 +271,7 @@
   <code>DataSource</code> that is used by the application (torque).  The other is
   a <code>ConnectionPoolDataSource</code> that is provided as part of a jdbc2
   driver.  If the jdbc driver implementation you are using does not fully
  -implement the jdbc2 specification.  commons-sandbox/jdbc2pool provides an
  +implement the jdbc2 specification.  commons-jdbc2pool provides an
   adapter for older <code>Driver</code> based drivers.  Another alternative is
   provided in commons/dbcp where <code>BasicDataSource</code> provides a
   <code>DataSource</code> frontend, and has properties to directly configure
  @@ -215,7 +306,7 @@
   these other uses, or if you just want to follow your j2ee environment's
   standard jndi deployment pattern, torque can just make use of these externally
   deployed pools.  Here is an example using catalina of deploying the pool that 
  -used to come with torque, but is now part of commons-sandbox/jdbc2pool.
  +used to come with torque, but is now part of commons-jdbc2pool.
   </p>
   
   <p>In server.xml, the following would be added to the &lt;Context&gt; for your
  @@ -283,7 +374,7 @@
   ]]></source>
   
   <p>
  -Remember that commons-sandbox/jdbc2pool pools expect a 
  +Remember that commons-jdbc2pool pools expect a 
   <code>ConnectionPoolDataSource</code>
   available via jndi under the name given in the dataSourceName, so you will
   need entries in server.xml and web.xml for this object as well.
  
  
  

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

Reply via email to