org.apache.openjpa.lib.jdbc
Class LoggingConnectionDecorator.LoggingConnection

java.lang.Object
  extended by org.apache.openjpa.lib.jdbc.DelegatingConnection
      extended by org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.LoggingConnection
All Implemented Interfaces:
Connection, Wrapper, Closeable
Enclosing class:
LoggingConnectionDecorator

protected class LoggingConnectionDecorator.LoggingConnection
extends DelegatingConnection

Logging connection.


Nested Class Summary
protected  class LoggingConnectionDecorator.LoggingConnection.LoggingCallableStatement
          CallableStatement decorated with logging.
protected  class LoggingConnectionDecorator.LoggingConnection.LoggingDatabaseMetaData
          Metadata wrapper that logs actions.
protected  class LoggingConnectionDecorator.LoggingConnection.LoggingPreparedStatement
           
protected  class LoggingConnectionDecorator.LoggingConnection.LoggingResultSet
          Warning-handling result set.
protected  class LoggingConnectionDecorator.LoggingConnection.LoggingStatement
          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
LoggingConnectionDecorator.LoggingConnection(Connection conn)
           
 
Method Summary
 void close()
           
 void commit()
           
protected  Statement createStatement(boolean wrap)
          Create a statement, with the option of not wrapping it in a DelegatingStatement, which is the default.
protected  Statement createStatement(int type, int concurrency, boolean wrap)
          Create a statement, with the option of not wrapping it in a DelegatingStatement, 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 a DelegatingDatabaseMetaData, which is the default.
protected  CallableStatement prepareCall(String sql, boolean wrap)
          Prepare a call, with the option of not wrapping it in a DelegatingCallableStatement, which is the default.
protected  PreparedStatement prepareStatement(String sql, boolean wrap)
          Prepare a statement, with the option of not wrapping it in a DelegatingPreparedStatement, 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 a DelegatingPreparedStatement, 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 rollback(Savepoint savepoint)
           
 Savepoint setSavepoint()
           
 Savepoint 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
 

Constructor Detail

LoggingConnectionDecorator.LoggingConnection

public LoggingConnectionDecorator.LoggingConnection(Connection conn)
                                             throws SQLException
Throws:
SQLException
Method Detail

prepareStatement

protected PreparedStatement prepareStatement(String sql,
                                             boolean wrap)
                                      throws SQLException
Description copied from class: DelegatingConnection
Prepare a statement, with the option of not wrapping it in a DelegatingPreparedStatement, which is the default.

Overrides:
prepareStatement in class DelegatingConnection
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 a DelegatingPreparedStatement, which is the default.

Overrides:
prepareStatement in class DelegatingConnection
Throws:
SQLException

createStatement

protected Statement createStatement(boolean wrap)
                             throws SQLException
Description copied from class: DelegatingConnection
Create a statement, with the option of not wrapping it in a DelegatingStatement, which is the default.

Overrides:
createStatement in class DelegatingConnection
Throws:
SQLException

createStatement

protected Statement createStatement(int type,
                                    int concurrency,
                                    boolean wrap)
                             throws SQLException
Description copied from class: DelegatingConnection
Create a statement, with the option of not wrapping it in a DelegatingStatement, which is the default.

Overrides:
createStatement in class DelegatingConnection
Throws:
SQLException

prepareCall

protected CallableStatement prepareCall(String sql,
                                        boolean wrap)
                                 throws SQLException
Description copied from class: DelegatingConnection
Prepare a call, with the option of not wrapping it in a DelegatingCallableStatement, which is the default.

Overrides:
prepareCall in class DelegatingConnection
Throws:
SQLException

commit

public void commit()
            throws SQLException
Specified by:
commit in interface Connection
Overrides:
commit in class DelegatingConnection
Throws:
SQLException

rollback

public void rollback()
              throws SQLException
Specified by:
rollback in interface Connection
Overrides:
rollback in class DelegatingConnection
Throws:
SQLException

close

public void close()
           throws SQLException
Specified by:
close in interface Connection
Specified by:
close in interface Closeable
Overrides:
close in class DelegatingConnection
Throws:
SQLException

setSavepoint

public Savepoint setSavepoint()
                       throws SQLException
Specified by:
setSavepoint in interface Connection
Overrides:
setSavepoint in class DelegatingConnection
Throws:
SQLException

setSavepoint

public Savepoint setSavepoint(String name)
                       throws SQLException
Specified by:
setSavepoint in interface Connection
Overrides:
setSavepoint in class DelegatingConnection
Throws:
SQLException

rollback

public void rollback(Savepoint savepoint)
              throws SQLException
Specified by:
rollback in interface Connection
Overrides:
rollback in class DelegatingConnection
Throws:
SQLException

releaseSavepoint

public void releaseSavepoint(Savepoint savepoint)
                      throws SQLException
Specified by:
releaseSavepoint in interface Connection
Overrides:
releaseSavepoint in class DelegatingConnection
Throws:
SQLException

createStatement

protected Statement createStatement(int resultSetType,
                                    int resultSetConcurrency,
                                    int resultSetHoldability,
                                    boolean wrap)
                             throws SQLException
Overrides:
createStatement in class DelegatingConnection
Throws:
SQLException

prepareStatement

protected PreparedStatement prepareStatement(String sql,
                                             int resultSetType,
                                             int resultSetConcurrency,
                                             int resultSetHoldability,
                                             boolean wrap)
                                      throws SQLException
Overrides:
prepareStatement in class DelegatingConnection
Throws:
SQLException

prepareStatement

protected PreparedStatement prepareStatement(String sql,
                                             int autoGeneratedKeys,
                                             boolean wrap)
                                      throws SQLException
Overrides:
prepareStatement in class DelegatingConnection
Throws:
SQLException

prepareStatement

protected PreparedStatement prepareStatement(String sql,
                                             int[] columnIndexes,
                                             boolean wrap)
                                      throws SQLException
Overrides:
prepareStatement in class DelegatingConnection
Throws:
SQLException

prepareStatement

protected PreparedStatement prepareStatement(String sql,
                                             String[] columnNames,
                                             boolean wrap)
                                      throws SQLException
Overrides:
prepareStatement in class DelegatingConnection
Throws:
SQLException

getMetaData

protected DatabaseMetaData getMetaData(boolean wrap)
                                throws SQLException
Description copied from class: DelegatingConnection
Return the metadata, with the option of not wrapping it in a DelegatingDatabaseMetaData, which is the default.

Overrides:
getMetaData in class DelegatingConnection
Throws:
SQLException


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.