|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.lang.Thread
|
+--com.opencms.dbpool.CmsPool
This class is used to create an connection-pool for opencms.
| Field Summary |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
CmsPool(String poolname,
String driver,
String url,
String user,
String password,
int minConn,
int maxConn,
int increasRate,
int timeout,
int maxage)
Creates a new Pool. |
|
CmsPool(String poolname,
String driver,
String url,
String user,
String password,
int minConn,
int maxConn,
int increasRate,
int timeout,
int maxage,
String conTestQuery)
Creates a new Pool. |
|
| Method Summary | |
Connection |
connect()
Try to make a database connection to the given database. |
void |
destroy()
Destroys this pool. |
void |
putConnection(CmsConnection con)
Puts a connection back to the pool. |
void |
run()
The run-method for the connection-guard |
protected boolean |
testConnection(Connection con)
Test the connection by executing an select statement. |
String |
toString()
Returns a string representation of this object. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public CmsPool(String poolname,
String driver,
String url,
String user,
String password,
int minConn,
int maxConn,
int increasRate,
int timeout,
int maxage)
throws SQLException
poolname - - the name of this pool.driver - - the classname of the driver.url - - the url to connect to the database.user - - the user to access the db.password - - the password to connect to the db.minConn - - the minimum amount Connections maintained in the pool.maxConn - - the maximum amount Connections maintained in the pool.timeout - - the timout after a unused connection has to be closed.
SQLException - - if a SQL-Error occurs.
public CmsPool(String poolname,
String driver,
String url,
String user,
String password,
int minConn,
int maxConn,
int increasRate,
int timeout,
int maxage,
String conTestQuery)
throws SQLException
poolname - - the name of this pool.driver - - the classname of the driver.url - - the url to connect to the database.user - - the user to access the db.password - - the password to connect to the db.minConn - - the minimum amount Connections maintained in the pool.maxConn - - the maximum amount Connections maintained in the pool.timeout - - the timout after a unused connection has to be closed.conTestQuery - - the test query to test a connection before
delivering. If this is set to null, no test will be performed.
SQLException - - if a SQL-Error occurs.| Method Detail |
public void run()
run in interface Runnablerun in class Thread
public Connection connect()
throws SQLException
SQLException - if a database-access error occurs.public void putConnection(CmsConnection con)
public String toString()
toString in class Threadpublic void destroy()
destroy in class Threadprotected boolean testConnection(Connection con)
con - The connection to test.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||