Skip to content

Commit

Permalink
Undo invalid optimization with stronger comment
Browse files Browse the repository at this point in the history
  • Loading branch information
harawata committed May 7, 2023
1 parent 28abe61 commit c596ae7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ private void executeStatement(String command) throws SQLException {
}
try {
boolean hasResults = statement.execute(sql);
while (hasResults || statement.getUpdateCount() != -1) {
// DO NOT try to 'imporove' the condition even if IDE tells you to!
// It's important that getUpdateCount() is called here.
while (!(!hasResults && statement.getUpdateCount() == -1)) {
checkWarnings(statement);
printResults(statement, hasResults);
hasResults = statement.getMoreResults();
Expand Down

0 comments on commit c596ae7

Please sign in to comment.