public Connection executeUpdate() {
long start = System.currentTimeMillis();
try {
this.logExecution();
PreparedStatement statement = this.buildPreparedStatement();
this.connection.setResult(statement.executeUpdate());
this.connection.setKeys(this.returnGeneratedKeys ? statement.getGeneratedKeys() : null);
this.connection.setCanGetKeys(this.returnGeneratedKeys);
} catch (SQLException var7) {
this.connection.onException();
throw new Sql2oException("Error in executeUpdate, " + var7.getMessage(), var7);
} finally {
this.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;
}
Мне интересно, как проверить, не прошло ли обновление. Я использую запрос:
update my_table set some_field=:some_value
where the_key = :the_key_value
И, непосредственно перед запуском executeUpdate()
, я удаляю запись, где the_key == "the_key_value"
.
Кто-нибудь знает правильный способ определить, не произошло ли обновление?
Кроме того, когда я иду на Javadoc и нажимаю на что-нибудь, я получаю:
Объект CDN не найден - Запросить идентификатор: c6a9ba5f-f8ea-46ae-bf7a-efc084971878-19055563
Есть ли способ создать Javadoc локально?
РЕДАКТИРОВАТЬ: способ проверить это с помощью Connection.getResult()
? Возвращает ли количество обновленных / вставленных записей и т.д.?