Package 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.lang.AutoCloseable
,java.sql.Statement
,java.sql.Wrapper
,Closeable
- Enclosing class:
- LoggingConnectionDecorator.LoggingConnection
protected 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.
-
-
Constructor Summary
Constructors Constructor Description LoggingStatement(java.sql.Statement stmnt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendInfo(java.lang.StringBuffer buf)
void
cancel()
boolean
execute(java.lang.String sql)
boolean
execute(java.lang.String sql, int i)
boolean
execute(java.lang.String sql, int[] ia)
boolean
execute(java.lang.String sql, java.lang.String[] sa)
protected java.sql.ResultSet
executeQuery(java.lang.String sql, boolean wrap)
Execute the query, with the option of not wrapping it in aDelegatingResultSet
, which is the default.int
executeUpdate(java.lang.String sql)
int
executeUpdate(java.lang.String sql, int i)
int
executeUpdate(java.lang.String sql, int[] ia)
int
executeUpdate(java.lang.String sql, java.lang.String[] sa)
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, closeOnCompletion, equals, executeBatch, executeQuery, getConnection, getDelegate, getFetchDirection, getFetchSize, getGeneratedKeys, getInnermostDelegate, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, hashCode, initialize, isClosed, isCloseOnCompletion, isPoolable, isWrapperFor, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, toString, unwrap
-
-
-
-
Method Detail
-
appendInfo
public void appendInfo(java.lang.StringBuffer buf)
- Overrides:
appendInfo
in classDelegatingStatement
-
wrapResult
protected java.sql.ResultSet wrapResult(java.sql.ResultSet rs, boolean wrap)
- Overrides:
wrapResult
in classDelegatingStatement
-
cancel
public void cancel() throws java.sql.SQLException
- Specified by:
cancel
in interfacejava.sql.Statement
- Overrides:
cancel
in classDelegatingStatement
- 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 aDelegatingResultSet
, which is the default.- Overrides:
executeQuery
in classDelegatingStatement
- Throws:
java.sql.SQLException
-
executeUpdate
public int executeUpdate(java.lang.String sql) throws java.sql.SQLException
- Specified by:
executeUpdate
in interfacejava.sql.Statement
- Overrides:
executeUpdate
in classDelegatingStatement
- Throws:
java.sql.SQLException
-
execute
public boolean execute(java.lang.String sql) throws java.sql.SQLException
- Specified by:
execute
in interfacejava.sql.Statement
- Overrides:
execute
in classDelegatingStatement
- Throws:
java.sql.SQLException
-
executeUpdate
public int executeUpdate(java.lang.String sql, int i) throws java.sql.SQLException
- Specified by:
executeUpdate
in interfacejava.sql.Statement
- Overrides:
executeUpdate
in classDelegatingStatement
- Throws:
java.sql.SQLException
-
executeUpdate
public int executeUpdate(java.lang.String sql, int[] ia) throws java.sql.SQLException
- Specified by:
executeUpdate
in interfacejava.sql.Statement
- Overrides:
executeUpdate
in classDelegatingStatement
- Throws:
java.sql.SQLException
-
executeUpdate
public int executeUpdate(java.lang.String sql, java.lang.String[] sa) throws java.sql.SQLException
- Specified by:
executeUpdate
in interfacejava.sql.Statement
- Overrides:
executeUpdate
in classDelegatingStatement
- Throws:
java.sql.SQLException
-
execute
public boolean execute(java.lang.String sql, int i) throws java.sql.SQLException
- Specified by:
execute
in interfacejava.sql.Statement
- Overrides:
execute
in classDelegatingStatement
- Throws:
java.sql.SQLException
-
execute
public boolean execute(java.lang.String sql, int[] ia) throws java.sql.SQLException
- Specified by:
execute
in interfacejava.sql.Statement
- Overrides:
execute
in classDelegatingStatement
- Throws:
java.sql.SQLException
-
execute
public boolean execute(java.lang.String sql, java.lang.String[] sa) throws java.sql.SQLException
- Specified by:
execute
in interfacejava.sql.Statement
- Overrides:
execute
in classDelegatingStatement
- Throws:
java.sql.SQLException
-
-