example:
wrong is :
- Code: Select all
public boolean execute(String sql)
throws SQLException {
boolean result = false;
checkClosed();
try {
if (this.logStatementsEnabled && logger.isDebugEnabled()){
logger.debug(PoolUtil.fillLogParams(sql, this.logParams));
}
long timer = queryTimerStart();
if (this.connectionHook != null){
this.connectionHook.onBeforeStatementExecute(this.connectionHandle, this, sql, this.logParams);
}
result = this.internalStatement.execute(sql);
if (this.connectionHook != null){
this.connectionHook.onAfterStatementExecute(this.connectionHandle, this, sql, this.logParams);
}
queryTimerEnd(sql, timer);
} catch (SQLException e) {
throw this.connectionHandle.markPossiblyBroken(e);
}
return result;
}
right is :
- Code: Select all
public boolean execute(String sql)
throws SQLException {
boolean result = false;
checkClosed();
try {
if (this.logStatementsEnabled && logger.isDebugEnabled()){
logger.debug(PoolUtil.fillLogParams(sql, this.logParams));
}
long timer = queryTimerStart();
if (this.connectionHook != null){
this.connectionHook.onBeforeStatementExecute(this.connectionHandle, this, sql, this.logParams);
}
result = this.internalStatement.execute(sql);
if (this.connectionHook != null){
this.connectionHook.onAfterStatementExecute(this.connectionHandle, this, sql, this.logParams);
}
queryTimerEnd(sql, timer);
} catch (SQLException e) {
if (this.connectionHook != null){
this.connectionHook.onAfterStatementExecute(this.connectionHandle, this, sql, this.logParams);
}
throw this.connectionHandle.markPossiblyBroken(e);
}
return result;
}
