|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--velosurf.sql.StatementPool
This class is a pool of PooledStatements
| Field Summary | |
protected java.lang.Thread |
mCheckTimeoutThread
timeout checking thread |
protected int |
mCount
number of statements |
protected DBConnection |
mDBConnection
database connection |
protected boolean |
mRunning
is the thread running ? |
protected java.util.Vector |
mStatements
statements |
protected static long |
sCheckDelay
delay between checks |
protected static int |
sMaxStatements
maximum number of statements |
protected static long |
sTimeout
timeout on which statements are automatically recycled if not used |
| Constructor Summary | |
StatementPool(DBConnection inDBConnection)
builds a new pool |
|
| Method Summary | |
void |
clear()
close all statements |
protected void |
finalize()
close statements on exit |
PooledStatement |
getStatement()
gets a valid statement |
PooledStatement |
getTransactionStatement()
get a statement to be used in a transaction |
int[] |
getUsageStats()
debug - two ints long array containing nb of statements in use and total nb of statements |
void |
run()
run the loop of statements checking and recycling |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected DBConnection mDBConnection
protected int mCount
protected java.util.Vector mStatements
protected java.lang.Thread mCheckTimeoutThread
protected boolean mRunning
protected static long sCheckDelay
protected static long sTimeout
protected static int sMaxStatements
| Constructor Detail |
public StatementPool(DBConnection inDBConnection)
inDBConnection - database connection| Method Detail |
public PooledStatement getStatement()
throws java.sql.SQLException
java.sql.SQLException - thrown by the database engine
public PooledStatement getTransactionStatement()
throws java.sql.SQLException
java.sql.SQLException - thrown by the database enginepublic void run()
run in interface java.lang.Runnablepublic int[] getUsageStats()
public void clear()
protected void finalize()
finalize in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||