org.jdbcdslog
Class PreparedStatementLoggingHandler

java.lang.Object
  extended by org.jdbcdslog.LoggingHandlerSupport<T>
      extended by org.jdbcdslog.StatementLoggingHandlerTemplate<PreparedStatement>
          extended by org.jdbcdslog.PreparedStatementLoggingHandler
All Implemented Interfaces:
InvocationHandler
Direct Known Subclasses:
CallableStatementLoggingHandler

public class PreparedStatementLoggingHandler
extends StatementLoggingHandlerTemplate<PreparedStatement>


Field Summary
protected  List<Map<Integer,Object>> batchParameters
           
protected static Set<String> EXECUTE_METHODS
           
protected  Map<Integer,Object> parameters
           
protected static Set<String> SET_METHODS
           
protected  String sql
           
 
Fields inherited from class org.jdbcdslog.StatementLoggingHandlerTemplate
logMetaData
 
Fields inherited from class org.jdbcdslog.LoggingHandlerSupport
target, UNWRAP_METHOD_NAME
 
Constructor Summary
PreparedStatementLoggingHandler(LogMetaData logMetaData, PreparedStatement ps, String sql)
           
 
Method Summary
protected  void appendBatchStatements(StringBuilder sb)
           
protected  void appendStatement(StringBuilder sb, Object proxy, Method method, Object[] args)
           
protected  void doAddBatch(Object proxy, Method method, Object[] args)
           
protected  Object doAfterInvoke(Object proxy, Method method, Object[] args, Object result)
           
protected  void handleException(Throwable t, Object proxy, Method method, Object[] args)
           
protected  boolean needsLogging(Object proxy, Method method, Object[] args)
           
 
Methods inherited from class org.jdbcdslog.StatementLoggingHandlerTemplate
getLogger, getSlowQueryLogger, invoke, isAddBatch, isExecuteBatch, logAfterInvoke, logBeforeInvoke, needsSlowOperationLogging
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parameters

protected Map<Integer,Object> parameters

sql

protected String sql

batchParameters

protected List<Map<Integer,Object>> batchParameters

SET_METHODS

protected static final Set<String> SET_METHODS

EXECUTE_METHODS

protected static final Set<String> EXECUTE_METHODS
Constructor Detail

PreparedStatementLoggingHandler

public PreparedStatementLoggingHandler(LogMetaData logMetaData,
                                       PreparedStatement ps,
                                       String sql)
Method Detail

needsLogging

protected boolean needsLogging(Object proxy,
                               Method method,
                               Object[] args)
Overrides:
needsLogging in class StatementLoggingHandlerTemplate<PreparedStatement>

appendStatement

protected void appendStatement(StringBuilder sb,
                               Object proxy,
                               Method method,
                               Object[] args)
Specified by:
appendStatement in class StatementLoggingHandlerTemplate<PreparedStatement>

doAddBatch

protected void doAddBatch(Object proxy,
                          Method method,
                          Object[] args)
Specified by:
doAddBatch in class StatementLoggingHandlerTemplate<PreparedStatement>

appendBatchStatements

protected void appendBatchStatements(StringBuilder sb)
Specified by:
appendBatchStatements in class StatementLoggingHandlerTemplate<PreparedStatement>

doAfterInvoke

protected Object doAfterInvoke(Object proxy,
                               Method method,
                               Object[] args,
                               Object result)
Overrides:
doAfterInvoke in class StatementLoggingHandlerTemplate<PreparedStatement>

handleException

protected void handleException(Throwable t,
                               Object proxy,
                               Method method,
                               Object[] args)
                        throws Throwable
Overrides:
handleException in class StatementLoggingHandlerTemplate<PreparedStatement>
Throws:
Throwable


Copyright © 2015. All rights reserved.