|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DBConnectionManager
This interface is used to support different connection pooling packages such as Tyrex, DBCP, Minerva, PoolMan and Proxool. The client must first set the properties of the connection manager before making a call to {link #getConnection}
Method Summary | |
---|---|
java.sql.Connection |
getConnection()
Retrieve a connection to the underlying database for the pool of connections. |
void |
init()
Initialise the connection manager. |
void |
setDriver(java.lang.String driver)
Sets the JDBC driver class name |
void |
setEvictionInterval(long interval)
Sets the interval between checking idle connections for eviction. |
void |
setMaxActive(int active)
Sets the maximum number of active connections that can be allocated from this pool at the same time, or zero for no limit. |
void |
setMaxIdle(int idle)
Sets the maximum number of connections that can sit idle in the connection pool, before connections are evicted. |
void |
setMinIdleTime(long time)
Sets the minimum time that a connection may remain idle before it may be evicted, or zero for no eviction. |
void |
setPassword(java.lang.String password)
Sets the user's password that is used to access the database |
void |
setTestBeforeUse(boolean test)
Determines if connections should be tested before use. |
void |
setTestQuery(java.lang.String query)
Specifies an SQL query to validate connections. |
void |
setURL(java.lang.String url)
Sets the URL to the database |
void |
setUser(java.lang.String name)
Sets the user name that is used to obtain the connection |
Method Detail |
---|
void setUser(java.lang.String name)
name
- the user namevoid setPassword(java.lang.String password)
password
- the user's passwordvoid setDriver(java.lang.String driver)
driver
- the JDBC driver class namevoid setURL(java.lang.String url)
url
- the JDBC URLvoid setMaxActive(int active)
active
- the maximum number of active connectionsvoid setMaxIdle(int idle)
idle
- the maximum number of idle connectionsvoid setMinIdleTime(long time)
time
- the idle time, in secondsvoid setEvictionInterval(long interval)
setMinIdleTime(long)
seconds,
or if is specified, and the query fails.
interval
- the eviction interval, in secondsvoid setTestQuery(java.lang.String query)
query
- the test queryvoid setTestBeforeUse(boolean test)
test
- if true
, each connection is tested use.void init() throws PersistenceException
getConnection()
is made and after all the properties have been
set.
PersistenceException
- - if there is a problem with the initjava.sql.Connection getConnection() throws PersistenceException
PersistenceException
- - if there is a problem with the init
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |