Skip to content

Commit

Permalink
[java] Using try-with-resources to automatically close prepared state…
Browse files Browse the repository at this point in the history
…ments (forgot to change this one in revious commits)
  • Loading branch information
barancev committed Jun 16, 2020
1 parent 6f815c5 commit 8ae0feb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public Session get(SessionId id) throws NoSuchSessionException {
public void remove(SessionId id) {
Require.nonNull("Session ID", id);

try {
getDeleteSqlForSession(id).executeUpdate();
try (PreparedStatement statement = getDeleteSqlForSession(id)) {
statement.executeUpdate();
} catch (SQLException e) {
throw new JdbcException(e.getMessage());
}
Expand Down

0 comments on commit 8ae0feb

Please sign in to comment.