- GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("INSERT INTO `cats_passed` SET `user_id`=?, `variant_id`=?, `pass_date`=?");
- ps.setInt(1, user.getId());
- ps.setInt(2, getID(testType));
- ps.setTimestamp(3, new Timestamp(passDate.getTime()));
- ps.execute();
+ try (GigiPreparedStatement ps = new GigiPreparedStatement("INSERT INTO `cats_passed` SET `user_id`=?, `variant_id`=?, `pass_date`=?")) {
+ ps.setInt(1, user.getId());
+ ps.setInt(2, getID(testType));
+ ps.setTimestamp(3, new Timestamp(passDate.getTime()));
+ ps.execute();
+ }