return chain.preparedStatement_executeUpdate(statement);
}
long startMillis = System.currentTimeMillis();
ConnectionProxy connection = statement.getConnectionProxy();
{
TraceEvent event = new TraceEvent("PreparedStatementExecuteUpdateBefore", new Date(startMillis));
event.putContext(TRACE_CONN_INFO, connection.getProperties().clone());
event.putContext(TRACE_CONN_CONNECTED_TIME, connection.getConnectedTime());
event.putContext(TRACE_CONN_ID, connection.getId());
event.putContext(TRACE_STMT_ID, statement.getId());
event.putContext(TRACE_STMT_SQL, statement.getSql());
event.putContext(TRACE_STMT_PARAMS, getParameters(statement));
fireEvent(event);
}
try {
int updateCount = chain.preparedStatement_executeUpdate(statement);
long timespan = System.currentTimeMillis() - startMillis;
{
TraceAfterEvent event = new TraceAfterEvent("PreparedStatementExecuteQueryAfter",
new Date(startMillis), timespan);
event.putContext(TRACE_CONN_INFO, connection.getProperties().clone());
event.putContext(TRACE_CONN_CONNECTED_TIME, connection.getConnectedTime());
event.putContext(TRACE_CONN_ID, connection.getId());
event.putContext(TRACE_STMT_ID, statement.getId());
event.putContext(TRACE_STMT_SQL, statement.getSql());
event.putContext(TRACE_STMT_PARAMS, getParameters(statement));
event.putContext(TRACE_STMT_UPDATE_COUNT, updateCount);
fireEvent(event);
}
return updateCount;
} catch (SQLException ex) {
{
TraceErrorEvent event = new TraceErrorEvent("PreparedStatementExecuteUpdateError",
new Date(startMillis), ex);
event.putContext(TRACE_CONN_INFO, connection.getProperties().clone());
event.putContext(TRACE_CONN_CONNECTED_TIME, connection.getConnectedTime());
event.putContext(TRACE_CONN_ID, connection.getId());
event.putContext(TRACE_STMT_ID, statement.getId());
event.putContext(TRACE_STMT_SQL, statement.getSql());
event.putContext(TRACE_STMT_PARAMS, getParameters(statement));
fireEvent(event);
}
throw ex;
} catch (RuntimeException ex) {
{
TraceErrorEvent event = new TraceErrorEvent("PreparedStatementExecuteUpdateError",
new Date(startMillis), ex);
event.putContext(TRACE_CONN_INFO, connection.getProperties().clone());
event.putContext(TRACE_CONN_CONNECTED_TIME, connection.getConnectedTime());
event.putContext(TRACE_CONN_ID, connection.getId());
event.putContext(TRACE_STMT_ID, statement.getId());
event.putContext(TRACE_STMT_SQL, statement.getSql());
event.putContext(TRACE_STMT_PARAMS, getParameters(statement));
fireEvent(event);
}