Defines the properties that are required for creating a JDBC connection pool.
The restype attribute of the JDBCCONNECTIONPOOL element is reserved and ignored in Sun Java System Web Server 6.1. Any value set for this attribute is ignored by the server.
The following table describes subelements for the JDBCCONNECTIONPOOL element.
Table 2–44 JDBCCONNECTIONPOOL Subelements
Element |
Required |
Description |
---|---|---|
zero or one |
Contains a text description of this element. |
|
zero or more |
Specifies a property or a variable. |
|
zero or more |
Specifies the connection properties for the connection pool. |
The following table describes attributes for the JDBCCONNECTIONPOOL element.
Table 2–45 JDBCCONNECTIONPOOL Attributes
Attribute |
Default |
Description |
---|---|---|
name |
none |
Specifies the name of the connection pool. A JDBCRESOURCE element's poolname attribute refers to this name. |
datasourceclassname |
none |
Specifies the class name of the associated vendor-supplied data source. This class must implement java.sql.DataSource or java.sql.XADataSource or both. |
steadypoolsize |
8 |
(optional) Specifies the initial and minimum number of connections maintained in the pool. |
maxpoolsize |
32 |
(optional) Specifies the maximum number of connections that can be created to satisfy client requests. |
maxwaittime |
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. |
poolresizequantity |
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. |
idletimeout |
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. |
transactionisolationlevel |
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 isolationlevelguaranteed for more details. |
isolationlevelguaranteed |
true |
(optional) Applicable only when transactionisolationlevel is explicitly set. If true, every connection obtained from the pool is guaranteed to have the desired isolation level. This may impact performance on some JDBC drivers. You can set this attribute to false if you are certain that the hosted applications do not return connections with altered isolation levels. |
connectionvalidationrequired |
false |
(optional) Specifies whether connections must 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. Legal values are on, off, yes, no, 1, 0, true, false. |
connectionvalidationmethod |
auto-commit |
(optional) Legal values are as follows:
|
validationtablename |
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 connectionvalidationtype is set to table. |
failallconnections |
false |
(optional) If true, closes all connections in the pool if a single validation check fails. This parameter is mandatory if and only if isconnectionvalidationrequired is set to true. Legal values are on, off, yes, no, 1, 0, true, false. |
Most JDBC 2.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 Sun Java System Web Server, some properties may be necessary for most databases. For details, see Section 5.3 of the JDBC 2.0 Standard Extension API.
When properties are specified, they are passed to the vendor's data source class (specified by the datasourceclassname attribute) using setName(value) methods.
The following table describes some common properties for the JDBCCONNECTIONPOOL element. The left column lists the property name, and the right column describes what the property does.
Table 2–46 JDBCCONNECTIONPOOL Properties
Property |
Description |
---|---|
user |
Specifies the user name for this connection pool. |
password |
Specifies the password for this connection pool. |
databaseName |
Specifies the database for this connection pool. |
serverName |
Specifies the database server for this connection pool. |
port |
Specifies the port on which the database server listens for requests. |
networkProtocol |
Specifies the communication protocol. |
roleName |
Specifies the initial SQL role name. |
datasourceName |
Specifies an underlying XADataSource, or a ConnectionPoolDataSource if connection pooling is done. |
description |
Specifies a text description. |
url |
Specifies the URL for this connection pool. Although this is not a standard property, it is commonly used. |