Author: markt
Date: Wed Feb 26 11:14:31 2014
New Revision: 1572010
URL: http://svn.apache.org/r1572010
Log:
package.html -> package-info.java
Added:
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/cpdsadapter/package-info.java
- copied, changed from r1571967,
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/cpdsadapter/package.html
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/package-info.java
- copied, changed from r1571967,
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/package.html
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/package-info.java
- copied, changed from r1571967,
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/package.html
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/package-info.java
- copied, changed from r1571981,
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/package.html
Removed:
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/cpdsadapter/package.html
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/package.html
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/package.html
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/package.html
Copied:
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/cpdsadapter/package-info.java
(from r1571967,
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/cpdsadapter/package.html)
URL:
http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/cpdsadapter/package-info.java?p2=commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/cpdsadapter/package-info.java&p1=commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/cpdsadapter/package.html&r1=1571967&r2=1572010&rev=1572010&view=diff
==============================================================================
---
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/cpdsadapter/package.html
(original)
+++
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/cpdsadapter/package-info.java
Wed Feb 26 11:14:31 2014
@@ -1,81 +1,79 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<html>
-<body>
-
-<p>
-This package contains one public class which is a
-<code>ConnectionPoolDataSource</code> (CPDS) implementation that can be used to
-adapt older <code>Driver</code> based jdbc implementations. Below is an
-example of setting up the CPDS to be available via JNDI in the
-catalina servlet container.
-</p>
-<p>In server.xml, the following would be added to the <Context> for your
-webapp:
-</p>
-
-<pre>
- <Resource name="jdbc/bookstoreCPDS" auth="Container"
- type="org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS"/>
- <ResourceParams name="jdbc/bookstoreCPDS">
- <parameter>
- <name>factory</name>
-
<value>org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS</value>
- </parameter>
-
<parameter><name>user</name><value>root</value></parameter>
-
<parameter><name>password</name><value></value></parameter>
- <parameter>
- <name>driver</name>
-
<value>org.gjt.mm.mysql.Driver</value></parameter>
- <parameter>
- <name>url</name>
- <value>jdbc:mysql://localhost:3306/bookstore</value>
- </parameter>
- </ResourceParams>
-</pre>
-
-<p>
-In web.xml. Note that elements must be given in the order of the dtd
-described in the servlet specification:
-</p>
-
-<pre>
-<resource-ref>
- <description>
- Resource reference to a factory for java.sql.Connection
- instances that may be used for talking to a particular
- database that is configured in the server.xml file.
- </description>
- <res-ref-name>
- jdbc/bookstoreCPDS
- </res-ref-name>
- <res-type>
- org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS
- </res-type>
- <res-auth>
- Container
- </res-auth>
-</resource-ref>
-</pre>
-
-<p>
-Catalina deploys all objects configured similarly to above within the
-<strong>java:comp/env</strong> namespace.
-</p>
-
-</body>
-</html>
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * <p>
+ * This package contains one public class which is a
+ * <code>ConnectionPoolDataSource</code> (CPDS) implementation that can be
used to
+ * adapt older <code>Driver</code> based jdbc implementations. Below is an
+ * example of setting up the CPDS to be available via JNDI in the
+ * catalina servlet container.
+ * </p>
+ * <p>In server.xml, the following would be added to the <Context> for
your
+ * webapp:
+ * </p>
+ *
+ * <pre>
+ * <Resource name="jdbc/bookstoreCPDS" auth="Container"
+ *
type="org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS"/>
+ * <ResourceParams name="jdbc/bookstoreCPDS">
+ * <parameter>
+ * <name>factory</name>
+ *
<value>org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS</value>
+ * </parameter>
+ *
<parameter><name>user</name><value>root</value></parameter>
+ *
<parameter><name>password</name><value></value></parameter>
+ * <parameter>
+ * <name>driver</name>
+ *
<value>org.gjt.mm.mysql.Driver</value></parameter>
+ * <parameter>
+ * <name>url</name>
+ *
<value>jdbc:mysql://localhost:3306/bookstore</value>
+ * </parameter>
+ * </ResourceParams>
+ * </pre>
+ *
+ * <p>
+ * In web.xml. Note that elements must be given in the order of the dtd
+ * described in the servlet specification:
+ * </p>
+ *
+ * <pre>
+ * <resource-ref>
+ * <description>
+ * Resource reference to a factory for java.sql.Connection
+ * instances that may be used for talking to a particular
+ * database that is configured in the server.xml file.
+ * </description>
+ * <res-ref-name>
+ * jdbc/bookstoreCPDS
+ * </res-ref-name>
+ * <res-type>
+ * org.apache.commons.dbcp2.cpdsadapter.DriverAdapterCPDS
+ * </res-type>
+ * <res-auth>
+ * Container
+ * </res-auth>
+ * </resource-ref>
+ * </pre>
+ *
+ * <p>
+ * Catalina deploys all objects configured similarly to above within the
+ * <strong>java:comp/env</strong> namespace.
+ * </p>
+ */
+package org.apache.commons.dbcp2.cpdsadapter;
Copied:
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/package-info.java
(from r1571967,
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/package.html)
URL:
http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/package-info.java?p2=commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/package-info.java&p1=commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/package.html&r1=1571967&r2=1572010&rev=1572010&view=diff
==============================================================================
---
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/package.html
(original)
+++
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/datasources/package-info.java
Wed Feb 26 11:14:31 2014
@@ -1,188 +1,183 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<html>
-<body>
-<p>
-This package contains two DataSources: <code>PerUserPoolDataSource</code> and
-<code>SharedPoolDataSource</code> which provide a database connection pool.
-Below are a couple of usage examples. One shows deployment into a JNDI system.
-The other is a simple example initializing the pool using standard java code.
-</p>
-
-<h2>JNDI</h2>
-
-<p>
-Most
-J2EE containers will provide some way of deploying resources into JNDI. The
-method will vary among containers, but once the resource is available via
-JNDI, the application can access the resource in a container independent
-manner. The following example shows deployment into tomcat (catalina).
-</p>
-<p>In server.xml, the following would be added to the <Context> for your
-webapp:
-</p>
-
-<code><pre>
-
- <Resource name="jdbc/bookstore" auth="Container"
-
type="org.apache.commons.dbcp2.datasources.PerUserPoolPoolDataSource"/>
- <ResourceParams name="jdbc/bookstore">
- <parameter>
- <name>factory</name>
-
<value>org.apache.commons.dbcp2.datasources.PerUserPoolDataSourceFactory</value>
- </parameter>
- <parameter>
-
<name>dataSourceName</name><value>java:comp/env/jdbc/bookstoreCPDS</value>
- </parameter>
- <parameter>
- <name>defaultMaxTotal</name><value>30</value>
- </parameter>
-
- </ResourceParams>
-
-</pre></code>
-
-<p>
-In web.xml. Note that elements must be given in the order of the dtd
-described in the servlet specification:
-</p>
-
-<code><pre>
-<resource-ref>
- <description>
- Resource reference to a factory for java.sql.Connection
- instances that may be used for talking to a particular
- database that is configured in the server.xml file.
- </description>
- <res-ref-name>
- jdbc/bookstore
- </res-ref-name>
- <res-type>
- org.apache.commons.dbcp2.datasources.PerUserPoolDataSource
- </res-type>
- <res-auth>
- Container
- </res-auth>
-</resource-ref>
-</pre></code>
-
-
-<p>
-Apache Tomcat deploys all objects configured similarly to above within the
-<strong>java:comp/env</strong> namespace. So the JNDI path given for
-the dataSourceName parameter is valid for a
-<code>ConnectionPoolDataSource</code> that is deployed as given in the
-<a href="../cpdsadapter/package.html">cpdsadapter example</a>
-</p>
-
-<p>
-The <code>DataSource</code> is now available to the application as shown
-below:
-</p>
-
-<code><pre>
-
- Context ctx = new InitialContext();
- DataSource ds = (DataSource)
- ctx.lookup("java:comp/env/jdbc/bookstore");
- Connection con = null;
- try
- {
- con = ds.getConnection();
- ...
- use the connection
- ...
- }
- finally
- {
- if (con != null)
- con.close();
- }
-
-</pre></code>
-
-<p>
-The reference to the <code>DataSource</code> could be maintained, for
-multiple getConnection() requests. Or the <code>DataSource</code> can be
-looked up in different parts of the application code.
-<code>PerUserPoolDataSourceFactory</code> and
-<code>SharedPoolDataSourceFactory</code> will maintain the state of the pool
-between different lookups. This behavior may be different in other
-implementations.
-</p>
-
-<h2>Without JNDI</h2>
-
-<p>
-Connection pooling is useful in applications regardless of whether they run
-in a J2EE environment and a <code>DataSource</code> can be used within a
-simpler environment. The example below shows SharedPoolDataSource using
-DriverAdapterCPDS as the backend source, though any CPDS is applicable.
-</p>
-
-<code><pre>
-
-public class Pool
-{
- private static DataSource ds;
-
- static
- {
- DriverAdapterCPDS cpds = new DriverAdapterCPDS();
- cpds.setDriver("org.gjt.mm.mysql.Driver");
- cpds.setUrl("jdbc:mysql://localhost:3306/bookstore");
- cpds.setUser("foo");
- cpds.setPassword(null);
-
- SharedPoolDataSource tds = new SharedPoolDataSource();
- tds.setConnectionPoolDataSource(cpds);
- tds.setMaxTotal(10);
- tds.setMaxWaitMillis(50);
-
- ds = tds;
- }
-
- public static getConnection()
- {
- return ds.getConnection();
- }
-}
-
-</pre></code>
-
-<p>
-This class can then be used wherever a connection is needed:
-</p>
-
-<code><pre>
- Connection con = null;
- try
- {
- con = Pool.getConnection();
- ...
- use the connection
- ...
- }
- finally
- {
- if (con != null)
- con.close();
- }
-</pre></code>
-
-</body>
-</html>
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * <p>
+ * This package contains two DataSources: <code>PerUserPoolDataSource</code>
and
+ * <code>SharedPoolDataSource</code> which provide a database connection pool.
+ * Below are a couple of usage examples. One shows deployment into a JNDI
system.
+ * The other is a simple example initializing the pool using standard java
code.
+ * </p>
+ *
+ * <h2>JNDI</h2>
+ *
+ * <p>
+ * Most
+ * J2EE containers will provide some way of deploying resources into JNDI. The
+ * method will vary among containers, but once the resource is available via
+ * JNDI, the application can access the resource in a container independent
+ * manner. The following example shows deployment into tomcat (catalina).
+ * </p>
+ * <p>In server.xml, the following would be added to the <Context> for
your
+ * webapp:
+ * </p>
+ *
+ * <code><pre>
+ * <Resource name="jdbc/bookstore" auth="Container"
+ *
type="org.apache.commons.dbcp2.datasources.PerUserPoolPoolDataSource"/>
+ * <ResourceParams name="jdbc/bookstore">
+ * <parameter>
+ * <name>factory</name>
+ *
<value>org.apache.commons.dbcp2.datasources.PerUserPoolDataSourceFactory</value>
+ * </parameter>
+ * <parameter>
+ *
<name>dataSourceName</name><value>java:comp/env/jdbc/bookstoreCPDS</value>
+ * </parameter>
+ * <parameter>
+ * <name>defaultMaxTotal</name><value>30</value>
+ * </parameter>
+ * </ResourceParams>
+ * </pre></code>
+ *
+ * <p>
+ * In web.xml. Note that elements must be given in the order of the dtd
+ * described in the servlet specification:
+ * </p>
+ *
+ * <code><pre>
+ * <resource-ref>
+ * <description>
+ * Resource reference to a factory for java.sql.Connection
+ * instances that may be used for talking to a particular
+ * database that is configured in the server.xml file.
+ * </description>
+ * <res-ref-name>
+ * jdbc/bookstore
+ * </res-ref-name>
+ * <res-type>
+ * org.apache.commons.dbcp2.datasources.PerUserPoolDataSource
+ * </res-type>
+ * <res-auth>
+ * Container
+ * </res-auth>
+ * </resource-ref>
+ * </pre></code>
+ *
+ * <p>
+ * Apache Tomcat deploys all objects configured similarly to above within the
+ * <strong>java:comp/env</strong> namespace. So the JNDI path given for
+ * the dataSourceName parameter is valid for a
+ * <code>ConnectionPoolDataSource</code> that is deployed as given in the
+ * <a href="../cpdsadapter/package.html">cpdsadapter example</a>
+ * </p>
+ *
+ * <p>
+ * The <code>DataSource</code> is now available to the application as shown
+ * below:
+ * </p>
+ *
+ * <code><pre>
+ *
+ * Context ctx = new InitialContext();
+ * DataSource ds = (DataSource)
+ * ctx.lookup("java:comp/env/jdbc/bookstore");
+ * Connection con = null;
+ * try
+ * {
+ * con = ds.getConnection();
+ * ...
+ * use the connection
+ * ...
+ * }
+ * finally
+ * {
+ * if (con != null)
+ * con.close();
+ * }
+ *
+ * </pre></code>
+ *
+ * <p>
+ * The reference to the <code>DataSource</code> could be maintained, for
+ * multiple getConnection() requests. Or the <code>DataSource</code> can be
+ * looked up in different parts of the application code.
+ * <code>PerUserPoolDataSourceFactory</code> and
+ * <code>SharedPoolDataSourceFactory</code> will maintain the state of the pool
+ * between different lookups. This behavior may be different in other
+ * implementations.
+ * </p>
+ *
+ * <h2>Without JNDI</h2>
+ *
+ * <p>
+ * Connection pooling is useful in applications regardless of whether they run
+ * in a J2EE environment and a <code>DataSource</code> can be used within a
+ * simpler environment. The example below shows SharedPoolDataSource using
+ * DriverAdapterCPDS as the backend source, though any CPDS is applicable.
+ * </p>
+ *
+ * <code><pre>
+ *
+ * public class Pool
+ * {
+ * private static DataSource ds;
+ *
+ * static
+ * {
+ * DriverAdapterCPDS cpds = new DriverAdapterCPDS();
+ * cpds.setDriver("org.gjt.mm.mysql.Driver");
+ * cpds.setUrl("jdbc:mysql://localhost:3306/bookstore");
+ * cpds.setUser("foo");
+ * cpds.setPassword(null);
+ *
+ * SharedPoolDataSource tds = new SharedPoolDataSource();
+ * tds.setConnectionPoolDataSource(cpds);
+ * tds.setMaxTotal(10);
+ * tds.setMaxWaitMillis(50);
+ *
+ * ds = tds;
+ * }
+ *
+ * public static getConnection()
+ * {
+ * return ds.getConnection();
+ * }
+ * }
+ *
+ * </pre></code>
+ *
+ * <p>
+ * This class can then be used wherever a connection is needed:
+ * </p>
+ *
+ * <code><pre>
+ * Connection con = null;
+ * try
+ * {
+ * con = Pool.getConnection();
+ * ...
+ * use the connection
+ * ...
+ * }
+ * finally
+ * {
+ * if (con != null)
+ * con.close();
+ * }
+ * </pre></code>
+ */
+package org.apache.commons.dbcp2.datasources;
Copied:
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/package-info.java
(from r1571967,
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/package.html)
URL:
http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/package-info.java?p2=commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/package-info.java&p1=commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/package.html&r1=1571967&r2=1572010&rev=1572010&view=diff
==============================================================================
---
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/package.html
(original)
+++
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/managed/package-info.java
Wed Feb 26 11:14:31 2014
@@ -1,42 +1,40 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
- http://www.apache.org/licenses/LICENSE-2.0
+/**
+ * <p>
+ * This package provides support for pooling of ManagedConnections. A managed
+ * connection is responsible for managing a database connection in a
+ * transactional environment (typically called <i>Container Managed</i>).
+ * A managed connection opperates like any other connection when no gloabal
+ * transaction (a.k.a. XA transaction or JTA Transaction) is in progress.
+ * When a global transaction is active a single physical connection to the
+ * database is used by all ManagedConnections accessed in the scope of the
+ * transaction. Connection sharing means that all data access during a
+ * transaction has a consistent view of the database. When the global
+ * transaction is committed or rolled back the enlisted connections are
+ * committed or rolled back.
+ * </p>
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<html>
-<body>
-
-<p>
-This package provides support for pooling of ManagedConnections. A managed
-connection is responsible for managing a database connection in a
-transactional environment (typically called <i>Container Managed</i>).
-A managed connection opperates like any other connection when no gloabal
-transaction (a.k.a. XA transaction or JTA Transaction) is in progress.
-When a global transaction is active a single physical connection to the
-database is used by all ManagedConnections accessed in the scope of the
-transaction. Connection sharing means that all data access during a
-transaction has a consistent view of the database. When the global
-transaction is committed or rolled back the enlisted connections are
-committed or rolled back.
-</p>
-
-<p>
-This package supports full XADataSources and non-XA data sources using
-local transaction semantics. non-XA data sources commit and rollback as
-part of the transaction but are not recoverable in the case of an error
-because they do not implement the two-phase commit protocol.
-</p>
-
-</body>
-</html>
+ * <p>
+ * This package supports full XADataSources and non-XA data sources using
+ * local transaction semantics. non-XA data sources commit and rollback as
+ * part of the transaction but are not recoverable in the case of an error
+ * because they do not implement the two-phase commit protocol.
+ * </p>
+ */
+package org.apache.commons.dbcp2.managed;
Copied:
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/package-info.java
(from r1571981,
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/package.html)
URL:
http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/package-info.java?p2=commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/package-info.java&p1=commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/package.html&r1=1571981&r2=1572010&rev=1572010&view=diff
==============================================================================
---
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/package.html
(original)
+++
commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/package-info.java
Wed Feb 26 11:14:31 2014
@@ -1,137 +1,131 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<!-- $Id$ -->
-<html>
- <head>
- <title>Package Documentation for org.apache.commons.dbcp</title>
- </head>
- <body>
- <p>
- Database Connection Pool API.
- </p>
-
- <b>Overview in Dialog Form</b>
- <p>
- Q: How do I use the DBCP package?
- </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.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.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.pool2.ObjectPool ObjectPool}
interface is defined
- in Commons Pool. You can use one of the provided implementations such
as
- {@link org.apache.commons.pool2.impl.GenericObjectPool
GenericObjectPool},
- {@link org.apache.commons.pool2.proxy.ProxiedObjectPool
ProxiedObjectPool} or
- {@link org.apache.commons.pool2.impl.SoftReferenceObjectPool
SoftReferenceObjectPool}
- or you can create your own.
- </p>
- <p>
- 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.pool2.PooledObjectFactory
PooledObjectFactory}.
- 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.dbcp2.PoolableConnectionFactory}.
- It implements the factory and lifecycle methods of
- {@link org.apache.commons.pool2.PooledObjectFactory}
- 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.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.dbcp2.ConnectionFactory} are
- provided--one that uses {@link java.sql.DriverManager} to create
connections
- ({@link org.apache.commons.dbcp2.DriverManagerConnectionFactory}),
- one that uses a {@link java.sql.Driver} to create connections
- ({@link org.apache.commons.dbcp2.DriverConnectionFactory}),
- one that uses a {@link javax.sql.DataSource} to create connections
- ({@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?
- </p><p>
- A: Sure. Let's assume you want to create a {@link
javax.sql.DataSource}
- 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.dbcp2.PoolingDataSource}.
- </p><p>
- 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.pool2.ObjectPool}, you'll need
- a {@link org.apache.commons.pool2.PooledObjectFactory} that creates
- the actual {@link java.sql.Connection}s. That's what
- {@link org.apache.commons.dbcp2.PoolableConnectionFactory} is for.
- </p><p>
- To create the {@link
org.apache.commons.dbcp2.PoolableConnectionFactory},
- you'll need at least two things:
- <ol>
- <li>
- 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.pool2.ObjectPool}
- in which the {@link java.sql.Connection}s will be stored.
- <br></br>
- 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.PooledObjectFactory}
- for that pool.
- </li>
- </ol>
- </p><p>
- In code, that might look like this:
-<pre>GenericObjectPool connectionPool = new GenericObjectPool(null);
-ConnectionFactory connectionFactory = new
DriverManagerConnectionFactory("jdbc:some:connect:string", "username",
"password");
-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.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.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");
-PoolableConnectionFactory poolableConnectionFactory = new
PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true);
-PoolingDriver driver = new PoolingDriver();
-driver.registerPool("example",connectionPool);</pre>
- </p><p>
- 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:
-<pre>Connection conn =
DriverManager.getConnection("jdbc:apache:commons:dbcp:example");</pre>
- </p>
- </body>
-</html>
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * <p>
+ * Database Connection Pool API.
+ * </p>
+ *
+ * <b>Overview in Dialog Form</b>
+ * <p>
+ * Q: How do I use the DBCP package?
+ * </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.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.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.pool2.ObjectPool ObjectPool} interface
is defined
+ * in Commons Pool. You can use one of the provided implementations such as
+ * {@link org.apache.commons.pool2.impl.GenericObjectPool
GenericObjectPool},
+ * {@link org.apache.commons.pool2.proxy.ProxiedObjectPool
ProxiedObjectPool} or
+ * {@link org.apache.commons.pool2.impl.SoftReferenceObjectPool
SoftReferenceObjectPool}
+ * or you can create your own.
+ * </p>
+ * <p>
+ * 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.pool2.PooledObjectFactory
PooledObjectFactory}.
+ * 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.dbcp2.PoolableConnectionFactory}.
+ * It implements the factory and lifecycle methods of
+ * {@link org.apache.commons.pool2.PooledObjectFactory}
+ * 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.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.dbcp2.ConnectionFactory} are
+ * provided--one that uses {@link java.sql.DriverManager} to create
connections
+ * ({@link org.apache.commons.dbcp2.DriverManagerConnectionFactory}),
+ * one that uses a {@link java.sql.Driver} to create connections
+ * ({@link org.apache.commons.dbcp2.DriverConnectionFactory}),
+ * one that uses a {@link javax.sql.DataSource} to create connections
+ * ({@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?
+ * </p><p>
+ * A: Sure. Let's assume you want to create a {@link javax.sql.DataSource}
+ * 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.dbcp2.PoolingDataSource}.
+ * </p><p>
+ * 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.pool2.ObjectPool}, you'll need
+ * a {@link org.apache.commons.pool2.PooledObjectFactory} that creates
+ * the actual {@link java.sql.Connection}s. That's what
+ * {@link org.apache.commons.dbcp2.PoolableConnectionFactory} is for.
+ * </p><p>
+ * To create the {@link org.apache.commons.dbcp2.PoolableConnectionFactory},
+ * you'll need at least two things:
+ * <ol>
+ * <li>
+ * 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.pool2.ObjectPool}
+ * in which the {@link java.sql.Connection}s will be stored.
+ * <br></br>
+ * 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.PooledObjectFactory}
+ * for that pool.
+ * </li>
+ * </ol>
+ * </p><p>
+ * In code, that might look like this:
+ * <pre>GenericObjectPool connectionPool = new GenericObjectPool(null);
+ * ConnectionFactory connectionFactory = new
DriverManagerConnectionFactory("jdbc:some:connect:string", "username",
"password");
+ * 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.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.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");
+ * PoolableConnectionFactory poolableConnectionFactory = new
PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true);
+ * PoolingDriver driver = new PoolingDriver();
+ * driver.registerPool("example",connectionPool);</pre>
+ * </p><p>
+ * 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:
+ * <pre>Connection conn =
DriverManager.getConnection("jdbc:apache:commons:dbcp:example");</pre>
+ * </p>
+ */
+package org.apache.commons.dbcp2;