stmt = PreparedStatementLogger.newInstance(stmt, statementLog, queryStack); return stmt; } else if ("prepareCall".equals(method.getName())) { stmt = PreparedStatementLogger.newInstance(stmt, statementLog, queryStack); return stmt; } else if ("createStatement".equals(method.getName())) {
stmt = PreparedStatementLogger.newInstance(stmt, statementLog, queryStack); return stmt; } else if ("prepareCall".equals(method.getName())) { stmt = PreparedStatementLogger.newInstance(stmt, statementLog, queryStack); return stmt; } else if ("createStatement".equals(method.getName())) {
public Object invoke(Object proxy, Method method, Object[] params) throws Throwable { try { if ("prepareStatement".equals(method.getName())) { PreparedStatement stmt = (PreparedStatement) method.invoke(connection, params); stmt = PreparedStatementLogger.newInstance(stmt, (String) params[0]); return stmt; } else if ("prepareCall".equals(method.getName())) { PreparedStatement stmt = (PreparedStatement) method.invoke(connection, params); stmt = PreparedStatementLogger.newInstance(stmt, (String) params[0]); return stmt; } else if ("createStatement".equals(method.getName())) { Statement stmt = (Statement) method.invoke(connection, params); stmt = StatementLogger.newInstance(stmt); return stmt; } else if ("close".equals(method.getName())) { if (log.isDebugEnabled()) { log.debug("xxx Connection Closed"); } return method.invoke(connection, params); } else { return method.invoke(connection, params); } } catch (Throwable t) { Throwable t1 = ExceptionUtil.unwrapThrowable(t); log.error("Error calling Connection." + method.getName() + ':', t1); throw t1; } }