- GigiPreparedStatement enterPingResult = DatabaseConnection.getInstance().prepare("INSERT INTO `domainPinglog` SET `configId`=?, `state`=?::`pingState`, `result`=?, `challenge`=?");
- enterPingResult.setInt(1, configId);
- enterPingResult.setString(2, DomainPinger.PING_STILL_PENDING == state ? "open" : DomainPinger.PING_SUCCEDED.equals(state) ? "success" : "failed");
- enterPingResult.setString(3, result);
- enterPingResult.setString(4, token);
- enterPingResult.execute();
-
+ try (GigiPreparedStatement enterPingResult = new GigiPreparedStatement("INSERT INTO `domainPinglog` SET `configId`=?, `state`=?::`pingState`, `result`=?, `challenge`=?")) {
+ enterPingResult.setInt(1, configId);
+ enterPingResult.setString(2, DomainPinger.PING_STILL_PENDING == state ? "open" : DomainPinger.PING_SUCCEDED.equals(state) ? "success" : "failed");
+ enterPingResult.setString(3, result);
+ enterPingResult.setString(4, token);
+ enterPingResult.execute();
+ }