|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjodd.db.pool.CoreConnectionPool
A class for preallocating, recycling, and managing JDBC connections. It uses threads for opening a new connection. When no connection availiable it will wait until a connection is released.
Constructor Summary | |
CoreConnectionPool()
|
Method Summary | |
void |
close()
Close all the connections. |
void |
freeConnection(java.sql.Connection connection)
Returns connection to connection pool. |
java.sql.Connection |
getConnection()
Get one free connection from the connection pool. |
void |
init()
Initialize pool with current object state. |
void |
run()
|
void |
setDriver(java.lang.String s)
|
void |
setMaxConnections(int i)
|
void |
setMinConnections(int i)
|
void |
setPassword(java.lang.String s)
|
void |
setUrl(java.lang.String s)
|
void |
setUser(java.lang.String s)
|
void |
setWaitIfBusy(boolean b)
|
int |
totalConnections()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CoreConnectionPool()
Method Detail |
public void setDriver(java.lang.String s)
public void setUrl(java.lang.String s)
public void setUser(java.lang.String s)
public void setPassword(java.lang.String s)
public void setMaxConnections(int i)
public void setMinConnections(int i)
public void setWaitIfBusy(boolean b)
public void init() throws java.sql.SQLException
ConnectionPool
init
in interface ConnectionPool
java.sql.SQLException
public java.sql.Connection getConnection() throws java.sql.SQLException
ConnectionPool
getConnection
in interface ConnectionPool
java.sql.SQLException
public void run()
run
in interface java.lang.Runnable
public void freeConnection(java.sql.Connection connection)
ConnectionPool
freeConnection
in interface ConnectionPool
connection
- database connectionpublic int totalConnections()
public void close()
close
in interface ConnectionPool
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |