|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A simple connection pool interface.
| Method Summary | |
java.sql.Connection |
checkoutConn()
Get a connection from the pool. |
void |
destroy()
Destroy pool, releasing all DB connections. |
void |
init(java.lang.String url,
java.lang.String username,
java.lang.String password,
int poolSize)
Initialize with the given connection URL (DB specific), username, password ans pool size. |
void |
returnConn(java.sql.Connection conn)
Return a connection to the pool. |
| Method Detail |
public void init(java.lang.String url,
java.lang.String username,
java.lang.String password,
int poolSize)
throws java.sql.SQLException
url - DB specific connection URL.username - The username for DB authentication.password - The password for DB authentication.poolSize - The initial pool size.java.sql.SQLException - When the DB connection fails.public void destroy()
public java.sql.Connection checkoutConn()
throws java.sql.SQLException
java.sql.SQLException - In case the pool is exhausted and cannot be grown.
public void returnConn(java.sql.Connection conn)
throws java.sql.SQLException
conn - The Connection to return. The autoCommit property will be reset to false.java.sql.SQLException - Any DB related error.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||