- PreparedStatement ps = DatabaseConnection.getInstance().prepare("SELECT COUNT(*) FROM domainPinglog");
- while (true) {
- ResultSet rs = ps.executeQuery();
- rs.next();
- if (rs.getInt(1) >= count) {
- break;
+ try (GigiPreparedStatement ps = new GigiPreparedStatement("SELECT COUNT(*) FROM `domainPinglog`")) {
+ long start = System.currentTimeMillis();
+ while (System.currentTimeMillis() - start < 10000) {
+ GigiResultSet rs = ps.executeQuery();
+ rs.next();
+ if (rs.getInt(1) >= count) {
+ break;
+ }
+ Thread.sleep(200);