To Create a JDBC Connection Pool

When creating a connection pool with the Administration Console, you are defining the aspects of a connection to a specific database.

Before You Begin

To create a connection pool, you must first install and integrate a driver supporting the JDBC API (JDBC driver). See To Integrate a JDBC Driver.

The following information is required to create the JDBC connection pool. Gather this information before proceeding:

  1. In the navigation tree, select the Common Tasks node.

    The Common Tasks page opens.

  2. On the Common Tasks page, click the Create New JDBC Connection Pool button.

    The New JDBC Connection Pool (Step 1 of 2) page opens.


    Note - You can also access the New JDBC Connection Pool page by expanding the Resources node and the JDBC node, and selecting the Connection Pools node. Then from the Connection Pools page, click New to create a new connection pool.


  3. In the Name field, type a name for the new connection pool.

    This is a required field.

  4. From the Resource Type drop-down list, select a resource type.

    Choices include javax.sql.XADataSource (global transactions), java.sql.ConnectionPoolDataSource (local transactions, possible performance improvements), and javax.sql.DataSource (local transactions only).

  5. From the Database Vendor drop-down list, select a database vendor.
  6. Click Next.

    The New JDBC Connection Pool (Step 2 of 2) page opens.

  7. In the Datasource Classname field, type the name of the vendor-specific class that implements the DataSource and/or XADataSource APIs.

    This field is usually filled in automatically with the class name associated with the resource type and database vendor you chose.

  8. In the Description field, type a short description for the connection pool.
  9. In the Initial and Minimum Pool Size field, type the minimum number of connections for this pool.

    This value also determines the number of connections placed in the pool when the pool is first created or when application server starts. The default value is 8.

  10. In the Maximum Pool Size field, type the maximum number of connections for this pool.

    The default value is 32.

  11. In the Pool Resize Quantity field, type the number of connections per pool resizing batch.

    When the pool scales up and scales down toward the maximum and minimum pool size respectively, it is resized in batches. This value determines the number of connections in the batch. Making this value too large delays connection creation and recycling; making it too small will be less efficient. The default value is 2.

  12. In the Idle Timeout field, type the maximum amount of time, in seconds, that a connection can remain idle in the pool.

    After this time expires, the connection is removed from the pool. The default value is 30.

  13. In the Max Wait Time field, type the maximum amount of time, in milliseconds, that the application requesting a connection will wait before getting a connection timeout.

    The default value is 60,000.

  14. Select the Connection Validation Required checkbox to enable connection validation.

    Connection validation allows the server to reconnect in case of failure.

  15. From the Validation Method drop-down list, select a validation method.

    The application server can validate database connections in three ways: auto-commit, metadata, and table.

    Auto-commit and metadata

    The application server validates a connection by calling the con.getAutoCommit and con.getMetaData methods.


    Note - Many JDBC drivers cache the results of these calls. As a result, using these calls might not always provide reliable validations. Check with the driver vendor to determine whether these calls are cached or not.


    Table

    The application queries the specified database table. The table must exist and be accessible, but no rows are required. Do not use an existing table that has a large number of rows, or a table that is already frequently accessed.

  16. If you selected Table in the Validation Method drop-down list, then type the name of the database table in the Table Name field.

    The table name must contain only alphanumeric, underscore, dash, or dot characters.

  17. Select the Close All Connections On Any Failure checkbox to have the server close all connections in the pool and re-establish them when any connection fails.

    If this checkbox is deselected, individual connections are re-established only when they are used.

  18. Select the Allow Non Component Callers Enabled checkbox to allow the pool to be used by non-component callers.

    Examples of non-component callers include Servlet Filters.

  19. Select the Non Transactional Connections Enabled checkbox to return non-transactional connections.
  20. From the Transaction Isolation Level drop-down list, select a transaction isolation level for this connection pool.

    If not specified, the connections operate with default isolation levels provided by the JDBC driver.

  21. The Isolation Level Guaranteed checkbox is only applicable if a transaction isolation level has been specified in step 20.

    If the Guaranteed checkbox is selected, then all connections taken from the pool have the same isolation level. For example, if the isolation level for the connection is changed programmatically (with con.setTransactionIsolation) when last used, this mechanism changes the status back to the specified isolation level.

  22. (Optional) In the Additional Properties section, specify additional properties.

    Examples of required properties include database name (URL), user name, and password. For information on available properties, see Properties Specific to JDBC Connection Pools.

  23. Click Finish.
See Also