Package renames in docs
authorMark Thomas <markt@apache.org>
Tue, 10 Dec 2013 13:31:04 +0000 (13:31 +0000)
committerMark Thomas <markt@apache.org>
Tue, 10 Dec 2013 13:31:04 +0000 (13:31 +0000)
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/dbcp/trunk@1549840 13f79535-47bb-0310-9956-ffa450edef68

doc/README.txt
src/java/org/apache/commons/dbcp2/cpdsadapter/package.html
src/java/org/apache/commons/dbcp2/datasources/package.html
src/java/org/apache/commons/dbcp2/package.html
src/site/xdoc/guide/jndi-howto.xml

index 51b2fd5..b728fbe 100644 (file)
@@ -2,7 +2,7 @@
 
 Before running these examples make sure you have registered the database
 driver you want to use. If you don't you will get the following error:
-"org.apache.commons.dbcp.DbcpException: java.sql.SQLException: No suitable driver"
+"org.apache.commons.dbcp2.DbcpException: java.sql.SQLException: No suitable driver"
 
 The DriverManager class will attempt to load the driver classes referenced 
 in the "jdbc.drivers" system property. For example you might specify
index 9694822..f8be14b 100644 (file)
@@ -30,11 +30,11 @@ webapp:
 
 <pre>
  &lt;Resource name="jdbc/bookstoreCPDS" auth="Container"
-            type="org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS"/&gt;
+            type="org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS"/&gt;
   &lt;ResourceParams name="jdbc/bookstoreCPDS"&gt;
     &lt;parameter&gt;
       &lt;name&gt;factory&lt;/name&gt;
-      &lt;value&gt;org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS&lt;/value&gt;
+      &lt;value&gt;org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS&lt;/value&gt;
     &lt;/parameter&gt;
         &lt;parameter&gt;&lt;name&gt;user&lt;/name&gt;&lt;value&gt;root&lt;/value&gt;&lt;/parameter&gt;
         &lt;parameter&gt;&lt;name&gt;password&lt;/name&gt;&lt;value&gt;&lt;/value&gt;&lt;/parameter&gt;
@@ -64,7 +64,7 @@ described in the servlet specification:
     jdbc/bookstoreCPDS
   &lt;/res-ref-name&gt;
   &lt;res-type&gt;
-    org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS
+    org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS
   &lt;/res-type&gt;
   &lt;res-auth&gt;
     Container
index 6611677..d9ed7a4 100644 (file)
@@ -39,11 +39,11 @@ webapp:
 <code><pre>
 
  &lt;Resource name="jdbc/bookstore" auth="Container"
-            type="org.apache.commons.dbcp.datasources.PerUserPoolPoolDataSource"/&gt;
+            type="org.apache.commons.dbcp2.datasources.PerUserPoolPoolDataSource"/&gt;
   &lt;ResourceParams name="jdbc/bookstore"&gt;
     &lt;parameter&gt;
       &lt;name&gt;factory&lt;/name&gt;
-      &lt;value&gt;org.apache.commons.dbcp.datasources.PerUserPoolDataSourceFactory&lt;/value&gt;
+      &lt;value&gt;org.apache.commons.dbcp2.datasources.PerUserPoolDataSourceFactory&lt;/value&gt;
     &lt;/parameter&gt;
     &lt;parameter&gt;
       &lt;name&gt;dataSourceName&lt;/name&gt;&lt;value&gt;java:comp/env/jdbc/bookstoreCPDS&lt;/value&gt;
@@ -72,7 +72,7 @@ described in the servlet specification:
     jdbc/bookstore
   &lt;/res-ref-name&gt;
   &lt;res-type&gt;
-    org.apache.commons.dbcp.datasources.PerUserPoolDataSource
+    org.apache.commons.dbcp2.datasources.PerUserPoolDataSource
   &lt;/res-type&gt;
   &lt;res-auth&gt;
     Container
index 651d1e1..0240090 100644 (file)
       </p><p>
          A: There are two primary ways to access the DBCP pool, as a
          {@link java.sql.Driver Driver}, or as a {@link javax.sql.DataSource DataSource}.
-         You'll want to create an instance of {@link org.apache.commons.dbcp.PoolingDriver} or
-         {@link org.apache.commons.dbcp.PoolingDataSource}.  When using one of these
+         You'll want to create an instance of {@link org.apache.commons.dbcp2.PoolingDriver} or
+         {@link org.apache.commons.dbcp2.PoolingDataSource}.  When using one of these
          interfaces, you can just use your JDBC objects the way you normally would.
          Closing a {@link java.sql.Connection} will simply return it to its pool.
       </p>
       <p>
-         Q: But {@link org.apache.commons.dbcp.PoolingDriver PoolingDriver} and
-         {@link org.apache.commons.dbcp.PoolingDataSource PoolingDataSource} both expect an
-         {@link org.apache.commons.pool.ObjectPool ObjectPool} as an input.  Where do I
+         Q: But {@link org.apache.commons.dbcp2.PoolingDriver PoolingDriver} and
+         {@link org.apache.commons.dbcp2.PoolingDataSource PoolingDataSource} both expect an
+         {@link org.apache.commons.pool2.ObjectPool ObjectPool} as an input.  Where do I
          get one of those?
       </p><p>
-         A: The {@link org.apache.commons.pool.ObjectPool ObjectPool} interface is defined
+         A: The {@link org.apache.commons.pool2.ObjectPool ObjectPool} interface is defined
          in the {@link org.apache.commons.pool} package (Commons-Pool).
-         The {@link org.apache.commons.pool.impl} package has a couple of implementations,
+         The {@link org.apache.commons.pool2.impl} package has a couple of implementations,
          and you can always create your own.
       </p>
       <p>
-         Q: Ok, I've found an {@link org.apache.commons.pool.ObjectPool ObjectPool}
+         Q: Ok, I've found an {@link org.apache.commons.pool2.ObjectPool ObjectPool}
          implementation that I think suits my connection pooling needs.  But it wants
-         a {@link org.apache.commons.pool.PoolableObjectFactory PoolableObjectFactory}.
+         a {@link org.apache.commons.pool2.PoolableObjectFactory PoolableObjectFactory}.
          What should I use for that?
       </p><p>
          A: The DBCP package provides a class for this purpose. It's called
-         {@link org.apache.commons.dbcp.PoolableConnectionFactory}.
+         {@link org.apache.commons.dbcp2.PoolableConnectionFactory}.
          It implements the factory and lifecycle methods of
-         {@link org.apache.commons.pool.PoolableObjectFactory}
+         {@link org.apache.commons.pool2.PoolableObjectFactory}
          for {@link java.sql.Connection}s.  But it doesn't create the actual database
          {@link java.sql.Connection}s itself, it uses a
-         {@link org.apache.commons.dbcp.ConnectionFactory} for that.
-         The {@link org.apache.commons.dbcp.PoolableConnectionFactory} will take
-         {@link java.sql.Connection}s created by the {@link org.apache.commons.dbcp.ConnectionFactory}
+         {@link org.apache.commons.dbcp2.ConnectionFactory} for that.
+         The {@link org.apache.commons.dbcp2.PoolableConnectionFactory} will take
+         {@link java.sql.Connection}s created by the {@link org.apache.commons.dbcp2.ConnectionFactory}
          and wrap them with classes that implement the pooling behaviour.
       </p><p>
-         Several implementations of {@link org.apache.commons.dbcp.ConnectionFactory} are
+         Several implementations of {@link org.apache.commons.dbcp2.ConnectionFactory} are
          provided--one that uses {@link java.sql.DriverManager} to create connections
-         ({@link org.apache.commons.dbcp.DriverManagerConnectionFactory}),
+         ({@link org.apache.commons.dbcp2.DriverManagerConnectionFactory}),
          one that uses a {@link java.sql.Driver} to create connections
-         ({@link org.apache.commons.dbcp.DriverConnectionFactory}),
+         ({@link org.apache.commons.dbcp2.DriverConnectionFactory}),
          one that uses a {@link javax.sql.DataSource} to create connections
-         ({@link org.apache.commons.dbcp.DataSourceConnectionFactory}).
+         ({@link org.apache.commons.dbcp2.DataSourceConnectionFactory}).
       </p>
       <p>
          Q: I think I'm starting to get it, but can you walk me though it again?
          that pools {@link java.sql.Connection}s.  Let's also assume that
          those pooled {@link java.sql.Connection}s should be obtained from
          the {@link java.sql.DriverManager}.
-         You'll want to create a {@link org.apache.commons.dbcp.PoolingDataSource}.
+         You'll want to create a {@link org.apache.commons.dbcp2.PoolingDataSource}.
       </p><p>
-         The {@link org.apache.commons.dbcp.PoolingDataSource} uses an underlying
-         {@link org.apache.commons.pool.ObjectPool} to create and store its
+         The {@link org.apache.commons.dbcp2.PoolingDataSource} uses an underlying
+         {@link org.apache.commons.pool2.ObjectPool} to create and store its
          {@link java.sql.Connection}.
       </p><p>
-         To create a {@link org.apache.commons.pool.ObjectPool}, you'll need
-         a {@link org.apache.commons.pool.PoolableObjectFactory} that creates
+         To create a {@link org.apache.commons.pool2.ObjectPool}, you'll need
+         a {@link org.apache.commons.pool2.PoolableObjectFactory} that creates
          the actual {@link java.sql.Connection}s.  That's what
-         {@link org.apache.commons.dbcp.PoolableConnectionFactory} is for.
+         {@link org.apache.commons.dbcp2.PoolableConnectionFactory} is for.
       </p><p>
-         To create the {@link org.apache.commons.dbcp.PoolableConnectionFactory},
+         To create the {@link org.apache.commons.dbcp2.PoolableConnectionFactory},
          you'll need at least two things:
          <ol>
           <li>
-            A {@link org.apache.commons.dbcp.ConnectionFactory} from which
+            A {@link org.apache.commons.dbcp2.ConnectionFactory} from which
             the actual database {@link java.sql.Connection}s will be obtained.
           </li>
           <li>
-            An empty and factory-less {@link org.apache.commons.pool.ObjectPool}
+            An empty and factory-less {@link org.apache.commons.pool2.ObjectPool}
             in which the {@link java.sql.Connection}s will be stored.
             <br></br>
-            When you pass an {@link org.apache.commons.pool.ObjectPool} into the
-            {@link org.apache.commons.dbcp.PoolableConnectionFactory}, it will
-            automatically register itself as the {@link org.apache.commons.pool.PoolableObjectFactory}
+            When you pass an {@link org.apache.commons.pool2.ObjectPool} into the
+            {@link org.apache.commons.dbcp2.PoolableConnectionFactory}, it will
+            automatically register itself as the {@link org.apache.commons.pool2.PoolableObjectFactory}
             for that pool.
           </li>
          </ol>
-         You can optionally provide a {@link org.apache.commons.pool.KeyedObjectPoolFactory}
-         that will be used to create {@link org.apache.commons.pool.KeyedObjectPool}s for
+         You can optionally provide a {@link org.apache.commons.pool2.KeyedObjectPoolFactory}
+         that will be used to create {@link org.apache.commons.pool2.KeyedObjectPool}s for
          pooling {@link java.sql.PreparedStatement}s for each {@link java.sql.Connection}.
       </p><p>
          In code, that might look like this:
@@ -116,9 +116,9 @@ ConnectionFactory connectionFactory = new DriverManagerConnectionFactory("jdbc:s
 PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true);
 PoolingDataSource dataSource = new PoolingDataSource(connectionPool);</pre>
       </p><p>
-         To create a {@link org.apache.commons.dbcp.PoolingDriver}, we do the same thing,
+         To create a {@link org.apache.commons.dbcp2.PoolingDriver}, we do the same thing,
          except that instead of creating a {@link javax.sql.DataSource} on the last line,
-         we create a {@link org.apache.commons.dbcp.PoolingDriver}, and register the
+         we create a {@link org.apache.commons.dbcp2.PoolingDriver}, and register the
          <tt>connectionPool</tt> with it.  E.g.,:
 <pre>GenericObjectPool connectionPool = new GenericObjectPool(null);
 ConnectionFactory connectionFactory = new DriverManagerConnectionFactory("jdbc:some:connect:string", "username", "password");
@@ -126,7 +126,7 @@ PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFact
 PoolingDriver driver = new PoolingDriver();
 driver.registerPool("example",connectionPool);</pre>
       </p><p>
-         Since the {@link org.apache.commons.dbcp.PoolingDriver} registers itself
+         Since the {@link org.apache.commons.dbcp2.PoolingDriver} registers itself
          with the {@link java.sql.DriverManager} when it is created, now you can just
          go to the {@link java.sql.DriverManager} to create your {@link java.sql.Connection}s,
          like you normally would:
index 32c13db..ced107e 100644 (file)
@@ -54,8 +54,8 @@
 
   // Construct BasicDataSource reference
   Reference ref = new Reference("javax.sql.DataSource",
-    "org.apache.commons.dbcp.BasicDataSourceFactory", null);
-  ref.add(new StringRefAddr("driverClassName", "org.apache.commons.dbcp.TesterDriver"));
+    "org.apache.commons.dbcp2.BasicDataSourceFactory", null);
+  ref.add(new StringRefAddr("driverClassName", "org.apache.commons.dbcp2.TesterDriver"));
   ref.add(new StringRefAddr("url", "jdbc:apache:commons:testdriver"));
   ref.add(new StringRefAddr("username", "username"));
   ref.add(new StringRefAddr("password", "password"));
   InitialContext ic = new InitialContext();
 
   // Construct DriverAdapterCPDS reference
-  Reference cpdsRef = new Reference("org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS",
-    "org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS", null);
-  cpdsRef.add(new StringRefAddr("driver", "org.apache.commons.dbcp.TesterDriver"));
+  Reference cpdsRef = new Reference("org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS",
+    "org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS", null);
+  cpdsRef.add(new StringRefAddr("driver", "org.apache.commons.dbcp2.TesterDriver"));
   cpdsRef.add(new StringRefAddr("url", "jdbc:apache:commons:testdriver"));
   cpdsRef.add(new StringRefAddr("user", "foo"));
   cpdsRef.add(new StringRefAddr("password", "bar"));
   ic.rebind("jdbc/cpds", cpdsRef);
      
   // Construct PerUserPoolDataSource reference
-  Reference ref = new Reference("org.apache.commons.dbcp.datasources.PerUserPoolDataSource",
-    "org.apache.commons.dbcp.datasources.PerUserPoolDataSourceFactory", null);
+  Reference ref = new Reference("org.apache.commons.dbcp2.datasources.PerUserPoolDataSource",
+    "org.apache.commons.dbcp2.datasources.PerUserPoolDataSourceFactory", null);
   ref.add(new StringRefAddr("dataSourceName", "jdbc/cpds"));
   ref.add(new StringRefAddr("defaultMaxActive", "100"));
   ref.add(new StringRefAddr("defaultMaxIdle", "30"));