|
||||||||||
| 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 | |
|---|---|
private boolean |
checkConnections
do we need to check connections? |
private long |
checkInterval
minimal check interval |
private java.lang.Thread |
checkTimeoutThread
timeout checking thread. |
private ConnectionPool |
connectionPool
Connection pool. |
private int |
count
number of statements. |
private static int |
maxStatements
maximum number of statements. |
private boolean |
running
is the thread running? |
private java.util.List<PooledSimpleStatement> |
statements
statements. |
| Constructor Summary | |
|---|---|
protected |
StatementPool(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()
close statements on exit. |
PooledSimpleStatement |
getStatement()
get a valid statement. |
int[] |
getUsageStats()
debug - two ints long array containing nb of statements in use and total nb of statements. |
| 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 java.util.List<PooledSimpleStatement> statements
private java.lang.Thread checkTimeoutThread
private boolean running
private boolean checkConnections
private long checkInterval
private static final int maxStatements
| Constructor Detail |
|---|
protected StatementPool(ConnectionPool connectionPool,
boolean checkConnections,
long checkInterval)
connectionPool - connection pool| Method Detail |
|---|
public PooledSimpleStatement getStatement()
throws java.sql.SQLException
java.sql.SQLException - thrown by the database enginepublic int[] getUsageStats()
public void clear()
private 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 | |||||||||