org.skife.jdbi.v2.tweak
Interface SQLLog

All Known Implementing Classes:
FormattedLog, Log4JLog, NoOpLog, PrintStreamLog

public interface SQLLog

Interface used to receive sql logging events.


Nested Class Summary
static interface SQLLog.BatchLogger
          Instances of this are used to log batch statements.
 
Method Summary
 SQLLog.BatchLogger logBatch()
          Factory method used to obtain a SQLLog.BatchLogger which will be used to log a specific batch statement.
 void logBeginTransaction(Handle h)
          Called when a transaction is started
 void logCheckpointTransaction(Handle h, String name)
          Called when a transaction is checkpointed
 void logCommitTransaction(long time, Handle h)
          Called when a transaction is committed
 void logObtainHandle(long time, Handle h)
          Called when a handle is opened from a DBI instance
 void logPreparedBatch(long time, String sql, int count)
          Called to log a prepared batch execution
 void logReleaseCheckpointTransaction(Handle h, String name)
          Called when a transaction checkpoint is released
 void logReleaseHandle(Handle h)
          Called when a handle is closed
 void logRollbackToCheckpoint(long time, Handle h, String checkpointName)
          Called when a transaction checkpoint is rolled back to
 void logRollbackTransaction(long time, Handle h)
          Called when a transaction is committed
 void logSQL(long time, String sql)
          Called to log typical sql statements
 

Method Detail

logBatch

SQLLog.BatchLogger logBatch()
Factory method used to obtain a SQLLog.BatchLogger which will be used to log a specific batch statement.

Returns:
an instance of BatchLogger which will be used to log this batch

logBeginTransaction

void logBeginTransaction(Handle h)
Called when a transaction is started


logCheckpointTransaction

void logCheckpointTransaction(Handle h,
                              String name)
Called when a transaction is checkpointed

Parameters:
name - the checkpoint name

logCommitTransaction

void logCommitTransaction(long time,
                          Handle h)
Called when a transaction is committed


logObtainHandle

void logObtainHandle(long time,
                     Handle h)
Called when a handle is opened from a DBI instance


logPreparedBatch

void logPreparedBatch(long time,
                      String sql,
                      int count)
Called to log a prepared batch execution

Parameters:
sql - The sql for the prepared batch
count - the number of elements in the prepared batch

logReleaseCheckpointTransaction

void logReleaseCheckpointTransaction(Handle h,
                                     String name)
Called when a transaction checkpoint is released

Parameters:
name - the checkpoint name

logReleaseHandle

void logReleaseHandle(Handle h)
Called when a handle is closed


logRollbackToCheckpoint

void logRollbackToCheckpoint(long time,
                             Handle h,
                             String checkpointName)
Called when a transaction checkpoint is rolled back to


logRollbackTransaction

void logRollbackTransaction(long time,
                            Handle h)
Called when a transaction is committed


logSQL

void logSQL(long time,
            String sql)
Called to log typical sql statements

Parameters:
sql - the actual sql being exected


Copyright © 2011. All Rights Reserved.