Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
public interface ConnectionPoolConfiguration
AbstractConnectionPool
instances. Motivation for separating pool configuration into interface is
quite simple, it allows third-party applications to load configuration from
various sources (resource bundle, XML file, etc.).
Method Summary | |
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
int |
|
String |
|
int |
|
boolean |
|
boolean |
|
boolean |
|
public int getBlockingTimeout()
Get time during whichjavax.sql.ConnectionPoolDataSource.getPooledConnection()
can block. By default method blocks forever.
- Returns:
- pool blocking timeout in milliseconds,
Integer.MAX_VALUE
indicates blocking forever.
public int getIdleTimeout()
Deprecated. please use
getMaxIdleTime()
instead.Get time after which idle connections will be deallocated.
- Returns:
- idle timeout in milliseconds,
Integer.MAX_VALUE
indicates that idle connections are not removed.
public int getMaxConnections()
Deprecated. please use
getMaxPoolSize()
instead.Get maximum number of physical connections that can be simultaneously open.
- Returns:
- maximum number of simultaneously open physical database connections, 0 if no limit exists.
public int getMaxIdleTime()
Get time after which idle connections will be deallocated.
- Returns:
- idle timeout in milliseconds,
Integer.MAX_VALUE
indicates that idle connections are not removed.
public int getMaxPoolSize()
Get maximum number of physical connections that can be simultaneously open.
- Returns:
- maximum number of simultaneously open physical database connections, 0 if no limit exists.
public int getMinConnections()
Deprecated. please use
getMinPoolSize()
instead.Get minimum number of open JDBC connections that will be created when pool is started.
- Returns:
- minimum number of open JDBC connections to open at startup.
public int getMinPoolSize()
Get minimum number of open JDBC connections that will be created when pool is started.
- Returns:
- minimum number of open JDBC connections to open at startup.
public int getPingInterval()
Get time interval after which connection should be pinged.
- Returns:
- number of milliseconds in the ping interval.
public String getPingStatement()
Get SQL statement that will be used to ping connection. Ping SQL statement returns exactly one row without throwing an exception. Ping SQL statement must not influence the outcome of a transaction. Examples of ping SQL statements:
- Oracle:
"SELECT CAST(1 AS INTEGER) FROM DUAL"
- Firebird:
"SELECT CAST(1 AS INTEGER) FROM RDB$DATABASE"
- Returns:
- SQL statement that will be used to ping connection.
public int getRetryInterval()
Get interval of getting connections retries. It might happen that pool contains no free connection. In order not to wait until connection is returned into the pool, pool will try to obtain connection again and again with the interval returned by this method. Default value is 1000 (1 sec).
- Returns:
- retry interval in milliseconds.
public boolean isPingable()
Check if this pool supports pingable connections. Pingable connections are used to correctly check if connection is still alive or not.
- Returns:
true
if this pool supports pingable connections.
public boolean isPooling()
Check if this connection pool uses connection pooling, or just implements JDBC 2.0 SE interfaces. By default pooling is on. It might make sense to set pooling off to check performance degradation in test environment. It could be also used in the environment where physical connection must be closed right after usage, however using JDBC 2.0 SE interfaces is either a requirement or is simpler than standardjava.sql.Driver
.
- Returns:
true
if pooling is enabled.
public boolean isStatementPooling()
Check if this connection pool provides also prepared statement pooling. By default prepared statement pooling is enabled, however there might be situations where statement pooling is not desired, for example in environments where database can quickly run out of handles and fast handle reuse is required.
- Returns:
true
if prepared statement pooling is enabled.