|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.logicalcobwebs.proxool.AbstractProxyStatement
abstract class AbstractProxyStatement
Contains most of the functionality that we require to manipilate the statement. The subclass of this defines how we delegate to the real statement.
Field Summary | |
---|---|
private ConnectionPool |
connectionPool
|
private static java.text.DateFormat |
DATE_FORMAT
|
private static Log |
LOG
|
private java.util.Map |
parameters
|
private ProxyConnectionIF |
proxyConnection
|
private java.lang.StringBuffer |
sqlLog
|
private java.lang.String |
sqlStatement
|
private java.sql.Statement |
statement
|
Constructor Summary | |
---|---|
AbstractProxyStatement(java.sql.Statement statement,
ConnectionPool connectionPool,
ProxyConnectionIF proxyConnection,
java.lang.String sqlStatement)
|
Method Summary | |
---|---|
protected void |
appendToSqlLog()
Get the parameters that have been built up and use them to fill in any parameters withing the sqlStatement and produce a log. |
void |
close()
Close the statement and tell the ProxyConnection that it did so. |
boolean |
equals(java.lang.Object obj)
Whether the delegate statements are the same |
protected ConnectionPool |
getConnectionPool()
The connection pool we are using |
protected static java.lang.String |
getDateAsString(java.util.Date date)
|
java.sql.Statement |
getDelegateStatement()
Gets the real Statement that we got from the delegate driver |
protected java.sql.Statement |
getStatement()
The real, delegate statement |
protected boolean |
isTrace()
|
protected void |
putParameter(int index,
java.lang.Object value)
Add a parameter so that we can show its value when tracing |
protected void |
setSqlStatementIfNull(java.lang.String sqlStatement)
Sets sqlStatement if it isn't already set |
protected void |
startExecute()
|
protected boolean |
testException(java.lang.Throwable t)
Check to see whether an exception is a fatal one. |
protected void |
trace(long startTime,
java.lang.Exception exception)
Trace the call that was just made |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Log LOG
private static final java.text.DateFormat DATE_FORMAT
private java.sql.Statement statement
private ConnectionPool connectionPool
private ProxyConnectionIF proxyConnection
private java.util.Map parameters
private java.lang.String sqlStatement
private java.lang.StringBuffer sqlLog
Constructor Detail |
---|
public AbstractProxyStatement(java.sql.Statement statement, ConnectionPool connectionPool, ProxyConnectionIF proxyConnection, java.lang.String sqlStatement)
statement
- the real statement that we will delegate toconnectionPool
- the connection pool that we are usingproxyConnection
- the connection that was used to create the statementsqlStatement
- the SQL statement that was used to create this statement
(optional, can be null) so that we can use if for tracing.Method Detail |
---|
protected boolean testException(java.lang.Throwable t)
t
- the exception to testpublic java.sql.Statement getDelegateStatement()
protected ConnectionPool getConnectionPool()
protected java.sql.Statement getStatement()
public void close() throws java.sql.SQLException
java.sql.SQLException
- if it couldn't be closedProxyConnectionIF.registerClosedStatement(java.sql.Statement)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
protected void putParameter(int index, java.lang.Object value)
index
- within the procedurevalue
- an object describing its valueprotected void trace(long startTime, java.lang.Exception exception) throws java.sql.SQLException
startTime
- so we can log how long it tookexception
- if anything went wrong during execution
java.sql.SQLException
- if the onExecute
method threw one.protected void startExecute()
protected void appendToSqlLog()
protected boolean isTrace()
protected void setSqlStatementIfNull(java.lang.String sqlStatement)
sqlStatement
- the statement we are sending the databaseprotected static java.lang.String getDateAsString(java.util.Date date)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |