|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvelosurf.sql.StatementPool
public class StatementPool
This class is a pool of PooledStatements
| Field Summary | |
|---|---|
protected static long |
checkDelay
delay between checks |
protected java.lang.Thread |
checkTimeoutThread
timeout checking thread |
protected ConnectionPool |
connectionPool
Connection pool |
protected int |
count
number of statements |
protected static int |
maxStatements
maximum number of statements |
protected boolean |
running
is the thread running ? |
protected java.util.List |
statements
statements |
protected static long |
timeout
timeout on which statements are automatically recycled if not used |
| Constructor Summary | |
|---|---|
StatementPool(ConnectionPool connectionPool)
builds a new pool |
|
| Method Summary | |
|---|---|
void |
clear()
close all statements |
protected void |
dropConnection(java.sql.Connection connection)
|
protected void |
finalize()
close statements on exit |
PooledStatement |
getStatement()
gets a valid statement |
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 |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ConnectionPool connectionPool
protected int count
protected java.util.List statements
protected java.lang.Thread checkTimeoutThread
protected boolean running
protected static final long checkDelay
protected static final long timeout
protected static final int maxStatements
| Constructor Detail |
|---|
public StatementPool(ConnectionPool connectionPool)
connectionPool - connection pool| Method Detail |
|---|
public PooledStatement getStatement()
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 dropConnection(java.sql.Connection connection)
protected void finalize()
finalize in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||