[java] Using try-with-resources to automatically close prepared statements (forgot to change this one in revious commits)
@@ -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());
}
