org.apache.openjpa.lib.jdbc
Class LoggingConnectionDecorator.LoggingConnection.LoggingStatement
java.lang.Object
org.apache.openjpa.lib.jdbc.DelegatingStatement
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.LoggingConnection.LoggingStatement
- All Implemented Interfaces:
- java.sql.Statement, java.sql.Wrapper, Closeable
- Enclosing class:
- LoggingConnectionDecorator.LoggingConnection
protected abstract class LoggingConnectionDecorator.LoggingConnection.LoggingStatement
- extends DelegatingStatement
Statement wrapper that logs SQL to the parent data source and
remembers the last piece of SQL to be executed on it.
Fields inherited from interface java.sql.Statement |
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO |
Method Summary |
void |
appendInfo(java.lang.StringBuffer buf)
|
void |
cancel()
|
boolean |
execute(java.lang.String sql)
|
protected java.sql.ResultSet |
executeQuery(java.lang.String sql,
boolean wrap)
Execute the query, with the option of not wrapping it in a
DelegatingResultSet , which is the default. |
int |
executeUpdate(java.lang.String sql)
|
protected java.sql.ResultSet |
wrapResult(java.sql.ResultSet rs,
boolean wrap)
|
Methods inherited from class org.apache.openjpa.lib.jdbc.DelegatingStatement |
addBatch, clearBatch, clearWarnings, close, enforceAbstract, equals, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, getConnection, getDelegate, getFetchDirection, getFetchSize, getGeneratedKeys, getInnermostDelegate, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, hashCode, isWrapperFor, newInstance, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout, toString, unwrap |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.sql.Statement |
isClosed, isPoolable, setPoolable |
LoggingConnectionDecorator.LoggingConnection.LoggingStatement
public LoggingConnectionDecorator.LoggingConnection.LoggingStatement(java.sql.Statement stmnt)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
appendInfo
public void appendInfo(java.lang.StringBuffer buf)
- Overrides:
appendInfo
in class DelegatingStatement
wrapResult
protected java.sql.ResultSet wrapResult(java.sql.ResultSet rs,
boolean wrap)
- Overrides:
wrapResult
in class DelegatingStatement
cancel
public void cancel()
throws java.sql.SQLException
- Specified by:
cancel
in interface java.sql.Statement
- Overrides:
cancel
in class DelegatingStatement
- Throws:
java.sql.SQLException
executeQuery
protected java.sql.ResultSet executeQuery(java.lang.String sql,
boolean wrap)
throws java.sql.SQLException
- Description copied from class:
DelegatingStatement
- Execute the query, with the option of not wrapping it in a
DelegatingResultSet
, which is the default.
- Overrides:
executeQuery
in class DelegatingStatement
- Throws:
java.sql.SQLException
executeUpdate
public int executeUpdate(java.lang.String sql)
throws java.sql.SQLException
- Specified by:
executeUpdate
in interface java.sql.Statement
- Overrides:
executeUpdate
in class DelegatingStatement
- Throws:
java.sql.SQLException
execute
public boolean execute(java.lang.String sql)
throws java.sql.SQLException
- Specified by:
execute
in interface java.sql.Statement
- Overrides:
execute
in class DelegatingStatement
- Throws:
java.sql.SQLException