From bd96d09b7486da19feb1868682a29fdfb15eeaaa Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Wed, 16 Aug 2017 16:32:37 +0300 Subject: [PATCH] Fix statement not being closed --- .../java/com/djrapitops/plan/database/databases/SQLDB.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/database/databases/SQLDB.java b/Plan/src/main/java/com/djrapitops/plan/database/databases/SQLDB.java index a64ebd0fa..eb26e4925 100644 --- a/Plan/src/main/java/com/djrapitops/plan/database/databases/SQLDB.java +++ b/Plan/src/main/java/com/djrapitops/plan/database/databases/SQLDB.java @@ -150,7 +150,10 @@ public abstract class SQLDB extends Database { if (!newDatabase && getVersion() < 8) { setVersion(8); } - connection.prepareStatement("DROP TABLE IF EXISTS plan_locations").execute(); + + try (Statement statement = connection.createStatement()) { + statement.execute("DROP TABLE IF EXISTS plan_locations"); + } } return true; }