MCPcopy Index your code
hub / github.com/apache/groovy / executeUpdate

Method executeUpdate

subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java:3333–3347  ·  view source on GitHub ↗

Executes the given SQL update. Resource handling is performed automatically where appropriate. @param sql the SQL to execute @return the number of rows updated or 0 for SQL statements that return nothing @throws SQLException if a database access error occurs

(String sql)

Source from the content-addressed store, hash-verified

3331 * @throws SQLException if a database access error occurs
3332 */
3333 public int executeUpdate(String sql) throws SQLException {
3334 Connection connection = createConnection();
3335 Statement statement = null;
3336 try {
3337 statement = getStatement(connection, sql);
3338 this.updateCount = statement.executeUpdate(sql);
3339 cleanup(statement);
3340 return this.updateCount;
3341 } catch (SQLException e) {
3342 LOG.warning("Failed to execute: " + sql + " because: " + e.getMessage());
3343 throw e;
3344 } finally {
3345 closeResources(connection, statement);
3346 }
3347 }
3348
3349 /**
3350 * Executes the given SQL update with parameters.

Callers 3

addMethod · 0.80
executeInsertMethod · 0.80
callMethod · 0.80

Calls 10

createConnectionMethod · 0.95
getStatementMethod · 0.95
cleanupMethod · 0.95
closeResourcesMethod · 0.95
getPreparedStatementMethod · 0.95
singletonListMethod · 0.95
getParametersMethod · 0.95
asSqlMethod · 0.95
getMessageMethod · 0.45
asListMethod · 0.45

Tested by

no test coverage detected