|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfedora.server.storage.ConnectionPool
public class ConnectionPool
Provides a dispenser for database Connection Pools.
| Constructor Summary | |
|---|---|
ConnectionPool(java.lang.String driver,
java.lang.String url,
java.lang.String username,
java.lang.String password,
DDLConverter ddlConverter,
int maxActive,
int maxIdle,
long maxWait,
int minIdle,
long minEvictableIdleTimeMillis,
int numTestsPerEvictionRun,
long timeBetweenEvictionRunsMillis,
boolean testOnBorrow,
boolean testOnReturn,
boolean testWhileIdle,
byte whenExhaustedAction)
Constructs a ConnectionPool that can provide TableCreatingConnections. |
|
ConnectionPool(java.lang.String driver,
java.lang.String url,
java.lang.String username,
java.lang.String password,
int maxActive,
int maxIdle,
long maxWait,
int minIdle,
long minEvictableIdleTimeMillis,
int numTestsPerEvictionRun,
long timeBetweenEvictionRunsMillis,
boolean testOnBorrow,
boolean testOnReturn,
boolean testWhileIdle,
byte whenExhaustedAction)
Constructs a ConnectionPool based on the calling arguments. |
|
| Method Summary | |
|---|---|
void |
free(java.sql.Connection connection)
Releases the specified connection and returns it to the pool. |
java.sql.Connection |
getConnection()
Gets the next available connection. |
TableCreatingConnection |
getTableCreatingConnection()
Gets a TableCreatingConnection. |
protected void |
setConnectionProperties(java.util.Map props)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ConnectionPool(java.lang.String driver,
java.lang.String url,
java.lang.String username,
java.lang.String password,
int maxActive,
int maxIdle,
long maxWait,
int minIdle,
long minEvictableIdleTimeMillis,
int numTestsPerEvictionRun,
long timeBetweenEvictionRunsMillis,
boolean testOnBorrow,
boolean testOnReturn,
boolean testWhileIdle,
byte whenExhaustedAction)
throws java.sql.SQLException
Constructs a ConnectionPool based on the calling arguments.
driver - The JDBC driver class name.url - The JDBC connection URL.username - The database user name.password - The database password.maxActive - Maximum number of active instances in pool.maxIdle - Maximum number of idle instances in pool.maxWait - Maximum amount of time in milliseconds the borrowObject()
method should wait when whenExhaustedAction is set to
WHEN_EXHAUSTED_BLOCK.minIdle - Minimum of idle instances in pool.minEvictableIdleTimeMillis - Minimum amount of time in milliseconds
an object can be idle in pool before
eligible for eviction (if applicable).numTestsPerEvictionRun - Number of objects to be examined on each run of
idle evictor thread (if applicable).timeBetweenEvictionRunsMillis - Time in milliseconds to sleep between runs
of the idle object evictor thread.testOnBorrow - When true objects are validated before borrowed from the pool.testOnReturn - When true, objects are validated before returned to hte pool.testWhileIdle - When true, objects are validated by the idle object evictor thread.whenExhaustedAction - Action to take when a new object is requested and the
the pool has reached maximum number of active objects.
java.sql.SQLException - If the connection pool cannot be established for
any reason.
public ConnectionPool(java.lang.String driver,
java.lang.String url,
java.lang.String username,
java.lang.String password,
DDLConverter ddlConverter,
int maxActive,
int maxIdle,
long maxWait,
int minIdle,
long minEvictableIdleTimeMillis,
int numTestsPerEvictionRun,
long timeBetweenEvictionRunsMillis,
boolean testOnBorrow,
boolean testOnReturn,
boolean testWhileIdle,
byte whenExhaustedAction)
throws java.sql.SQLException
driver - The JDBC driver class name.url - The JDBC connection URL.username - The database user name.password - The he database password.ddlConverter - The DDLConverter that the TableCreatingConnections
should use when createTable(TableSpec) is called.maxActive - Maximum number of active instances in pool.maxIdle - Maximum number of idle instances in pool.maxWait - Maximum amount of time in milliseconds the borrowObject()
method should wait when whenExhaustedAction is set to
WHEN_EXHAUSTED_BLOCK.minIdle - Minimum of idle instances in pool.minEvictableIdleTimeMillis - Minimum amount of time in milliseconds
an object can be idle in pool before
eligible for eviction (if applicable).numTestsPerEvictionRun - Number of objects to be examined on each run of
idle evictor thread (if applicable).timeBetweenEvictionRunsMillis - Time in milliseconds to sleep between runs
of the idle object evictor thread.testOnBorrow - When true objects are validated before borrowed from the pool.testOnReturn - When true, objects are validated before returned to hte pool.testWhileIdle - When true, objects are validated by the idle object evictor thread.whenExhaustedAction - Action to take when a new object is requested and the
the pool has reached maximum number of active objects.
java.sql.SQLException - If the connection pool cannot be established for
any reason.| Method Detail |
|---|
protected void setConnectionProperties(java.util.Map props)
public TableCreatingConnection getTableCreatingConnection()
throws java.sql.SQLException
java.sql.SQLException - If there is any propblem in getting the SQL
connection.
public java.sql.Connection getConnection()
throws java.sql.SQLException
Gets the next available connection.
java.sql.SQLException - If the maximum number of connections has been reached
or there is some other problem in obtaining the connection.public void free(java.sql.Connection connection)
Releases the specified connection and returns it to the pool.
connection - A JDBC connection.public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||