try {
rewritten.bind(getParameters(), stmt);
}
catch (SQLException e) {
throw new UnableToExecuteStatementException("Unable to bind parameters to query", e);
}
try {
prep.prepare(stmt);
}
catch (SQLException e) {
throw new UnableToExecuteStatementException("Unable to prepare JDBC statement", e);
}
for (StatementCustomizer customizer : customizers) {
try {
customizer.beforeExecution(stmt, context);
}
catch (SQLException e) {
throw new UnableToExecuteStatementException("Exception thrown in statement customization", e);
}
}
try {
final long start = System.currentTimeMillis();
stmt.execute();
log.logSQL(System.currentTimeMillis() - start, rewritten.getSql());
}
catch (SQLException e) {
throw new UnableToExecuteStatementException(e);
}
for (StatementCustomizer customizer : customizers) {
try {
customizer.afterExecution(stmt, context);
}
catch (SQLException e) {
throw new UnableToExecuteStatementException("Exception thrown in statement customization", e);
}
}
try {
rs = stmt.getResultSet();