boolean executeUpdatePreparedStatement(Connection conn, String statement, List<Object> arguments, boolean close)
throws SQLException {
long time = System.currentTimeMillis();
try (PreparedStatement ps = conn.prepareStatement(statement);
CachedRowSet data = RowSetProvider.newFactory().createCachedRowSet()) {
if (arguments != null) {
prepareStatementForExecuteUpdate(arguments, ps);
}
ps.executeUpdate();
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("SQL SUCCESS. rows returned: {}, time(ms): {}", data.size(),
(System.currentTimeMillis() - time));
}
} catch (SQLException exc) {
handleSqlExceptionForExecuteStatement(conn, statement, arguments, exc, time);
} finally {
try {
if (close) {
conn.close();
}
} catch (Exception exc) {
LOGGER.error(exc.getLocalizedMessage(), exc);
}
}
return true;
}