Defines the properties that are required for creating a JDBC connection pool.
The following table describes subelements for the jdbc-connection-pool element.
Table 1–59 jdbc-connection-pool Subelements
Element |
Required |
Description |
---|---|---|
zero or one |
Contains a text description of this element. |
|
zero or more |
Specifies a property or a variable. |
The following table describes attributes for the jdbc-connection-pool element.
Table 1–60 jdbc-connection-pool Attributes
Attribute |
Default |
Description |
---|---|---|
none |
Specifies the name of the connection pool. A jdbc-resource element’s pool-name attribute refers to this name. |
|
none |
Specifies the class name of the associated vendor-supplied data source. This class must implement java.sql.DataSource, java.sql.XADataSource , javax.sql.ConnectionPoolDatasource, or a combination. |
|
javax.sql. DataSource |
(optional) Specifies the interface the data source class implements. The value of this attribute can be javax.sql.DataSource, javax.sql.XADataSource , or javax.sql.ConnectionPoolDatasource. If the value is not one of these interfaces, the default is used. An error occurs if this attribute has a legal value and the indicated interface is not implemented by the data source class. |
|
8 |
(optional) Specifies the initial and minimum number of connections maintained in the pool. |
|
32 |
(optional) Specifies the maximum number of connections that can be created to satisfy client requests. |
|
60000 |
(optional) Specifies the amount of time, in milliseconds, that the caller is willing to wait for a connection. If 0, the caller is blocked indefinitely until a resource is available or an error occurs. |
|
2 |
(optional) Specifies the number of connections to be destroyed if the existing number of connections is above the steady-pool-size (subject to the max-pool-size limit). This is enforced periodically at the idle-time-out-in-seconds interval. An idle connection is one that has not been used for a period of idle-time-out-in-seconds . |
|
300 |
(optional) Specifies the maximum time that a connection can remain idle in the pool. After this amount of time, the pool can close this connection. |
|
default JDBC driver isolation level |
(optional) Specifies the transaction isolation level on the pooled database connections. Allowed values are read-uncommitted, read-committed , repeatable-read, or serializable. Applications that change the isolation level on a pooled connection programmatically risk polluting the pool, which can lead to errors. See is-isolation-level-guaranteed for more details. |
|
true |
(optional) Applicable only when transaction-isolation-level is explicitly set. If true, every connection obtained from the pool is guaranteed to have the desired isolation level. This might impact performance on some JDBC drivers. Only set this attribute to false if you are certain that the hosted applications do not return connections with altered isolation levels. |
|
false |
(optional) Specifies whether connections have to be validated before being given to the application. If a resource’s validation fails, it is destroyed, and a new resource is created and returned. |
|
auto-commit |
(optional) Legal values are as follows:
|
|
none |
(optional) Specifies the table name to be used to perform a query to validate a connection. This parameter is mandatory if and only if connection-validation-type is set to table. |
|
false |
(optional) If true, closes all connections in the pool if a single validation check fails. This parameter is mandatory if and only if is-connection-validation-required is set to true. |
Most JDBC 3.0 drivers allow use of standard property lists to specify the user, password, and other resource configuration information. Although properties are optional with respect to the Application Server, some properties might be necessary for most databases. For details, see the JDBC 3.0 Standard Extension API.
When properties are specified, they are passed to the vendor’s data source class (specified by the datasource-classname attribute) as is using setName(value) methods.
The user and password properties are used as the default principal if container managed authentication is specified and a default-resource-principal is not found in the application deployment descriptors.
The following table describes some common properties for the jdbc-connection-pool element.
Table 1–61 jdbc-connection-pool Properties
Property |
Description |
---|---|
Specifies the user name for this connection pool. |
|
Specifies the password for this connection pool. |
|
Specifies the database for this connection pool. |
|
Specifies the database server for this connection pool. |
|
Specifies the port on which the database server listens for requests. |
|
Specifies the communication protocol. |
|
Specifies the initial SQL role name. |
|
Specifies an underlying XADataSource, or a ConnectionPoolDataSource if connection pooling is done. |
|
Specifies a text description. |
|
Specifies the URL for this connection pool. Although this is not a standard property, it is commonly used. |