public Connection executeUpdate(){ long start = System.currentTimeMillis(); try{ logExecution(); PreparedStatement statement = buildPreparedStatement(); this.connection.setResult(statement.executeUpdate()); this.connection.setKeys(this.returnGeneratedKeys ? statement.getGeneratedKeys() : null); connection.setCanGetKeys(this.returnGeneratedKeys); } catch(SQLException ex){ this.connection.onException(); throw new Sql2oException("Error in executeUpdate, " + ex.getMessage(), ex); } finally { closeConnectionIfNecessary(); } long end = System.currentTimeMillis(); logger.debug("total: {} ms; executed update [{}]", new Object[]{ end - start, this.getName() == null ? "No name" : this.getName() }); return this.connection; }
public Connection executeUpdate() { long start = System.currentTimeMillis(); try { logExecution(); PreparedStatement statement = buildPreparedStatement(); this.connection.setResult(statement.executeUpdate()); this.connection.setKeys(this.returnGeneratedKeys ? statement.getGeneratedKeys() : null); connection.setCanGetKeys(this.returnGeneratedKeys); } catch (SQLException ex) { this.connection.onException(); throw new Sql2oException("Error in executeUpdate, " + ex.getMessage(), ex); } finally { closeConnectionIfNecessary(); } if (Anima.of().isEnableSQLStatistic() && log.isDebugEnabled()) { long end = System.currentTimeMillis(); log.debug("total: {} ms; executed update [{}]", end - start, this.getName() == null ? "No name" : this.getName()); } return this.connection; }
public Connection executeUpdate(){ long start = System.currentTimeMillis(); try{ logExecution(); PreparedStatement statement = buildPreparedStatement(); this.connection.setResult(statement.executeUpdate()); this.connection.setKeys(this.returnGeneratedKeys ? statement.getGeneratedKeys() : null); connection.setCanGetKeys(this.returnGeneratedKeys); } catch(SQLException ex){ this.connection.onException(); throw new Sql2oException("Error in executeUpdate, " + ex.getMessage(), ex); } finally { closeConnectionIfNecessary(); } long end = System.currentTimeMillis(); logger.debug("total: {} ms; executed update [{}]", new Object[]{ end - start, this.getName() == null ? "No name" : this.getName() }); return this.connection; }