|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
public void setUser(java.lang.String name)
name
- the user namepublic void setPassword(java.lang.String password)
password
- the user's passwordpublic void setDriver(java.lang.String driver)
driver
- the JDBC driver class namepublic void setURL(java.lang.String url)
url
- the JDBC URLpublic void setMaxActive(int active)
active
- the maximum number of active connectionspublic void setMaxIdle(int idle)
idle
- the maximum number of idle connectionspublic void setMinIdleTime(long time)
time
- the idle time, in secondspublic void setEvictionInterval(long interval)
setMinIdleTime(long)
seconds,
or if {@ link #testQuery} is specified, and the query fails.interval
- the eviction interval, in secondspublic void setTestQuery(java.lang.String query)
query
- the test querypublic void setTestBeforeUse(boolean test)
test
- if true
, each connection is tested use.public void init() throws PersistenceException
getConnection()
is made and after all the properties have been
set.PersistenceException
- - if there is a problem with the initpublic java.sql.Connection getConnection() throws PersistenceException
PersistenceException
- - if there is a problem with the init
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |