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
Nested ClassesModifier and TypeClassDescriptionprotected classCallableStatement decorated with logging.protected classMetadata wrapper that logs actions.protected classprotected classWarning-handling result set.protected classStatement 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidcommit()protected StatementcreateStatement(boolean wrap) Create a statement, with the option of not wrapping it in aDelegatingStatement, which is the default.protected StatementcreateStatement(int type, int concurrency, boolean wrap) Create a statement, with the option of not wrapping it in aDelegatingStatement, which is the default.protected StatementcreateStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability, boolean wrap) protected DatabaseMetaDatagetMetaData(boolean wrap) Return the metadata, with the option of not wrapping it in aDelegatingDatabaseMetaData, which is the default.protected CallableStatementprepareCall(String sql, boolean wrap) Prepare a call, with the option of not wrapping it in aDelegatingCallableStatement, which is the default.protected PreparedStatementprepareStatement(String sql, boolean wrap) Prepare a statement, with the option of not wrapping it in aDelegatingPreparedStatement, which is the default.protected PreparedStatementprepareStatement(String sql, int[] columnIndexes, boolean wrap) protected PreparedStatementprepareStatement(String sql, int autoGeneratedKeys, boolean wrap) protected PreparedStatementprepareStatement(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 PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, boolean wrap) protected PreparedStatementprepareStatement(String sql, String[] columnNames, boolean wrap) voidreleaseSavepoint(Savepoint savepoint) voidrollback()voidsetSavepoint(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, unwrapMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.sql.Connection
beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid
-
Constructor Details
-
LoggingConnection
- Throws:
SQLException
-
-
Method Details
-
prepareStatement
Description copied from class:DelegatingConnectionPrepare a statement, with the option of not wrapping it in aDelegatingPreparedStatement, which is the default.- Overrides:
prepareStatementin classDelegatingConnection- Throws:
SQLException
-
prepareStatement
protected PreparedStatement prepareStatement(String sql, int rsType, int rsConcur, boolean wrap) throws SQLException Description copied from class:DelegatingConnectionPrepare a statement, with the option of not wrapping it in aDelegatingPreparedStatement, which is the default.- Overrides:
prepareStatementin classDelegatingConnection- Throws:
SQLException
-
createStatement
Description copied from class:DelegatingConnectionCreate a statement, with the option of not wrapping it in aDelegatingStatement, which is the default.- Overrides:
createStatementin classDelegatingConnection- Throws:
SQLException
-
createStatement
Description copied from class:DelegatingConnectionCreate a statement, with the option of not wrapping it in aDelegatingStatement, which is the default.- Overrides:
createStatementin classDelegatingConnection- Throws:
SQLException
-
prepareCall
Description copied from class:DelegatingConnectionPrepare a call, with the option of not wrapping it in aDelegatingCallableStatement, which is the default.- Overrides:
prepareCallin classDelegatingConnection- Throws:
SQLException
-
commit
- Specified by:
commitin interfaceConnection- Overrides:
commitin classDelegatingConnection- Throws:
SQLException
-
rollback
- Specified by:
rollbackin interfaceConnection- Overrides:
rollbackin classDelegatingConnection- Throws:
SQLException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceConnection- Overrides:
closein classDelegatingConnection- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepointin interfaceConnection- Overrides:
setSavepointin classDelegatingConnection- Throws:
SQLException
-
setSavepoint
- Specified by:
setSavepointin interfaceConnection- Overrides:
setSavepointin classDelegatingConnection- Throws:
SQLException
-
rollback
- Specified by:
rollbackin interfaceConnection- Overrides:
rollbackin classDelegatingConnection- Throws:
SQLException
-
releaseSavepoint
- Specified by:
releaseSavepointin interfaceConnection- Overrides:
releaseSavepointin classDelegatingConnection- Throws:
SQLException
-
createStatement
protected Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability, boolean wrap) throws SQLException - Overrides:
createStatementin classDelegatingConnection- Throws:
SQLException
-
prepareStatement
protected PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability, boolean wrap) throws SQLException - Overrides:
prepareStatementin classDelegatingConnection- Throws:
SQLException
-
prepareStatement
protected PreparedStatement prepareStatement(String sql, int autoGeneratedKeys, boolean wrap) throws SQLException - Overrides:
prepareStatementin classDelegatingConnection- Throws:
SQLException
-
prepareStatement
protected PreparedStatement prepareStatement(String sql, int[] columnIndexes, boolean wrap) throws SQLException - Overrides:
prepareStatementin classDelegatingConnection- Throws:
SQLException
-
prepareStatement
protected PreparedStatement prepareStatement(String sql, String[] columnNames, boolean wrap) throws SQLException - Overrides:
prepareStatementin classDelegatingConnection- Throws:
SQLException
-
getMetaData
Description copied from class:DelegatingConnectionReturn the metadata, with the option of not wrapping it in aDelegatingDatabaseMetaData, which is the default.- Overrides:
getMetaDatain classDelegatingConnection- Throws:
SQLException
-