Package org.apache.openjpa.lib.jdbc
Class LoggingConnectionDecorator.LoggingConnection
java.lang.Object
org.apache.openjpa.lib.jdbc.DelegatingConnection
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.LoggingConnection
- All Implemented Interfaces:
AutoCloseable
,Connection
,Wrapper
,Closeable
- Enclosing class:
- LoggingConnectionDecorator
Logging connection.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
CallableStatement decorated with logging.protected class
Metadata wrapper that logs actions.protected class
protected class
Warning-handling result set.protected class
Statement wrapper that logs SQL to the parent data source and remembers the last piece of SQL to be executed on it. -
Field Summary
Fields inherited from interface java.sql.Connection
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
commit()
protected Statement
createStatement
(boolean wrap) Create a statement, with the option of not wrapping it in aDelegatingStatement
, which is the default.protected Statement
createStatement
(int type, int concurrency, boolean wrap) Create a statement, with the option of not wrapping it in aDelegatingStatement
, which is the default.protected Statement
createStatement
(int resultSetType, int resultSetConcurrency, int resultSetHoldability, boolean wrap) protected DatabaseMetaData
getMetaData
(boolean wrap) Return the metadata, with the option of not wrapping it in aDelegatingDatabaseMetaData
, which is the default.protected CallableStatement
prepareCall
(String sql, boolean wrap) Prepare a call, with the option of not wrapping it in aDelegatingCallableStatement
, which is the default.protected PreparedStatement
prepareStatement
(String sql, boolean wrap) Prepare a statement, with the option of not wrapping it in aDelegatingPreparedStatement
, which is the default.protected PreparedStatement
prepareStatement
(String sql, int[] columnIndexes, boolean wrap) protected PreparedStatement
prepareStatement
(String sql, int autoGeneratedKeys, boolean wrap) protected PreparedStatement
prepareStatement
(String sql, int rsType, int rsConcur, boolean wrap) Prepare a statement, with the option of not wrapping it in aDelegatingPreparedStatement
, which is the default.protected PreparedStatement
prepareStatement
(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, boolean wrap) protected PreparedStatement
prepareStatement
(String sql, String[] columnNames, boolean wrap) void
releaseSavepoint
(Savepoint savepoint) void
rollback()
void
setSavepoint
(String name) Methods inherited from class org.apache.openjpa.lib.jdbc.DelegatingConnection
abort, appendInfo, clearWarnings, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, equals, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getDelegate, getHoldability, getInnermostDelegate, getMetaData, getNetworkTimeout, getSchema, getTransactionIsolation, getTypeMap, getWarnings, hashCode, isClosed, isReadOnly, isValid, isWrapperFor, nativeSQL, prepareCall, prepareCall, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setNetworkTimeout, setReadOnly, setSchema, setTransactionIsolation, setTypeMap, toString, unwrap
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.sql.Connection
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
Constructor Details
-
LoggingConnection
- Throws:
SQLException
-
-
Method Details
-
prepareStatement
Description copied from class:DelegatingConnection
Prepare a statement, with the option of not wrapping it in aDelegatingPreparedStatement
, which is the default.- Overrides:
prepareStatement
in classDelegatingConnection
- Throws:
SQLException
-
prepareStatement
protected PreparedStatement prepareStatement(String sql, int rsType, int rsConcur, boolean wrap) throws SQLException Description copied from class:DelegatingConnection
Prepare a statement, with the option of not wrapping it in aDelegatingPreparedStatement
, which is the default.- Overrides:
prepareStatement
in classDelegatingConnection
- Throws:
SQLException
-
createStatement
Description copied from class:DelegatingConnection
Create a statement, with the option of not wrapping it in aDelegatingStatement
, which is the default.- Overrides:
createStatement
in classDelegatingConnection
- Throws:
SQLException
-
createStatement
Description copied from class:DelegatingConnection
Create a statement, with the option of not wrapping it in aDelegatingStatement
, which is the default.- Overrides:
createStatement
in classDelegatingConnection
- Throws:
SQLException
-
prepareCall
Description copied from class:DelegatingConnection
Prepare a call, with the option of not wrapping it in aDelegatingCallableStatement
, which is the default.- Overrides:
prepareCall
in classDelegatingConnection
- Throws:
SQLException
-
commit
- Specified by:
commit
in interfaceConnection
- Overrides:
commit
in classDelegatingConnection
- Throws:
SQLException
-
rollback
- Specified by:
rollback
in interfaceConnection
- Overrides:
rollback
in classDelegatingConnection
- Throws:
SQLException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceConnection
- Overrides:
close
in classDelegatingConnection
- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepoint
in interfaceConnection
- Overrides:
setSavepoint
in classDelegatingConnection
- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepoint
in interfaceConnection
- Overrides:
setSavepoint
in classDelegatingConnection
- Throws:
SQLException
-
rollback
- Specified by:
rollback
in interfaceConnection
- Overrides:
rollback
in classDelegatingConnection
- Throws:
SQLException
-
releaseSavepoint
- Specified by:
releaseSavepoint
in interfaceConnection
- Overrides:
releaseSavepoint
in classDelegatingConnection
- Throws:
SQLException
-
createStatement
protected Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability, boolean wrap) throws SQLException - Overrides:
createStatement
in classDelegatingConnection
- Throws:
SQLException
-
prepareStatement
protected PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, boolean wrap) throws SQLException - Overrides:
prepareStatement
in classDelegatingConnection
- Throws:
SQLException
-
prepareStatement
protected PreparedStatement prepareStatement(String sql, int autoGeneratedKeys, boolean wrap) throws SQLException - Overrides:
prepareStatement
in classDelegatingConnection
- Throws:
SQLException
-
prepareStatement
protected PreparedStatement prepareStatement(String sql, int[] columnIndexes, boolean wrap) throws SQLException - Overrides:
prepareStatement
in classDelegatingConnection
- Throws:
SQLException
-
prepareStatement
protected PreparedStatement prepareStatement(String sql, String[] columnNames, boolean wrap) throws SQLException - Overrides:
prepareStatement
in classDelegatingConnection
- Throws:
SQLException
-
getMetaData
Description copied from class:DelegatingConnection
Return the metadata, with the option of not wrapping it in aDelegatingDatabaseMetaData
, which is the default.- Overrides:
getMetaData
in classDelegatingConnection
- Throws:
SQLException
-