|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.evanmclean.evlib.sql.PreparedStatementCache
public class PreparedStatementCache
Keeps a cache prepared statements, based on the SQL. Calling the close() method closes and removes all statements in the cache.
| Constructor Summary | |
|---|---|
PreparedStatementCache(Connection conn)
Initialise the cache to use the specified database connection. |
|
| Method Summary | |
|---|---|
void |
close()
Closes all statements in the cache. |
void |
close(String sql)
Close a specific prepared statement, based on it's SQL. |
PreparedStatement |
get(String sql)
Get the prepared statement based on the sql string. |
PreparedStatement |
get(String sql,
int resultSetType,
int resultSetConcurrency)
Get the prepared statement based on the sql string. |
Connection |
getConnection()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PreparedStatementCache(Connection conn)
conn - | Method Detail |
|---|
public void close()
throws SQLException
SQLException
public void close(String sql)
throws SQLException
sql - The SQL of the statement to close.
SQLException
public PreparedStatement get(String sql)
throws SQLException
sql - The SQL for the statement.
SQLException
public PreparedStatement get(String sql,
int resultSetType,
int resultSetConcurrency)
throws SQLException
sql - The SQL for the statement.resultSetType - resultSetConcurrency -
SQLExceptionpublic Connection getConnection()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||