|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object velosurf.sql.PreparedStatementPool
public class PreparedStatementPool
This class is a pool of PooledPreparedStatements.
Field Summary | |
---|---|
private boolean |
checkConnections
do we need to check connections? |
private long |
checkInterval
minimal check interval |
private java.lang.Thread |
checkTimeoutThread
running thread. |
private ConnectionPool |
connectionPool
connection pool. |
private int |
count
statements count. |
private static int |
maxStatements
max number of statements. |
private boolean |
running
true if running. |
private HashMultiMap |
statementsMap
map queries -> statements. |
Constructor Summary | |
---|---|
protected |
PreparedStatementPool(ConnectionPool connectionPool,
boolean checkConnections,
long checkInterval)
build a new pool. |
Method Summary | |
---|---|
void |
clear()
close all statements. |
private void |
dropConnection(java.sql.Connection connection)
|
protected void |
finalize()
clear statements on exit. |
PooledPreparedStatement |
getPreparedStatement(java.lang.String query)
get a PooledPreparedStatement associated with this query. |
int[] |
getUsageStats()
debug - get usage statistics. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private ConnectionPool connectionPool
private int count
private HashMultiMap statementsMap
private java.lang.Thread checkTimeoutThread
private boolean running
private boolean checkConnections
private long checkInterval
private static final int maxStatements
Constructor Detail |
---|
protected PreparedStatementPool(ConnectionPool connectionPool, boolean checkConnections, long checkInterval)
connectionPool
- connection poolMethod Detail |
---|
public PooledPreparedStatement getPreparedStatement(java.lang.String query) throws java.sql.SQLException
query
- an SQL query
java.sql.SQLException
- thrown by the database enginepublic void clear()
private void dropConnection(java.sql.Connection connection)
protected void finalize()
finalize
in class java.lang.Object
public int[] getUsageStats()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |