From 35984bc18ca4340a2cee9aa3ce7f37ffbf6106a0 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Tue, 15 Jan 2019 19:39:29 +0100 Subject: [PATCH] Change to database class --- .../me/paradoxpixel/themepark/database/Database.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/me/paradoxpixel/themepark/database/Database.java b/src/main/java/me/paradoxpixel/themepark/database/Database.java index 1ab6dc9..9bcb549 100644 --- a/src/main/java/me/paradoxpixel/themepark/database/Database.java +++ b/src/main/java/me/paradoxpixel/themepark/database/Database.java @@ -105,6 +105,9 @@ public class Database { if(!connected()) connect(); + if(!connected()) + return false; + stopPool(); try { PreparedStatement statement = connection.prepareStatement(query); @@ -135,6 +138,9 @@ public class Database { if(!connected()) connect(); + if(!connected()) + return 0; + stopPool(); try { PreparedStatement statement = connection.prepareStatement(query); @@ -165,6 +171,9 @@ public class Database { if(!connected()) connect(); + if(!connected()) + return null; + stopPool(); try { PreparedStatement statement = connection.prepareStatement(query);