|
||||||||||
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 | |
---|---|
protected java.lang.Thread |
mCheckTimeoutThread
running thread |
protected ConnectionPool |
mConnectionPool
connection pool |
protected int |
mCount
statements count |
protected boolean |
mRunning
true if running |
protected HashMultiMap |
mStatementsMap
map queries -> statements |
protected static long |
sCheckDelay
check delay |
protected static int |
sMaxStatements
max number of statements |
protected static long |
sTimeout
after this timeout, statements are recycled even if not closed |
Constructor Summary | |
---|---|
protected |
PreparedStatementPool(ConnectionPool inConnectionPool)
builds a new pool |
Method Summary | |
---|---|
void |
clear()
close all statements |
protected void |
dropConnection(java.sql.Connection connection)
|
protected void |
finalize()
clear statements on exit |
PooledPreparedStatement |
getPreparedStatement(java.lang.String inQuery)
gets a PooledPreparedStatement associated with this query |
protected int[] |
getUsageStats()
debug - get usage statistics |
void |
run()
cycle through statements to check and recycle them |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ConnectionPool mConnectionPool
protected int mCount
protected HashMultiMap mStatementsMap
protected java.lang.Thread mCheckTimeoutThread
protected boolean mRunning
protected static final long sCheckDelay
protected static final long sTimeout
protected static final int sMaxStatements
Constructor Detail |
---|
protected PreparedStatementPool(ConnectionPool inConnectionPool)
inConnectionPool
- connection poolMethod Detail |
---|
public PooledPreparedStatement getPreparedStatement(java.lang.String inQuery) throws java.sql.SQLException
inQuery
- an SQL query
java.sql.SQLException
- thrown by the database enginepublic void run()
run
in interface java.lang.Runnable
public void clear()
protected void dropConnection(java.sql.Connection connection)
protected void finalize()
finalize
in class java.lang.Object
protected int[] getUsageStats()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |