diff --git a/src/main/java/world/bentobox/bentobox/database/mariadb/MariaDBDatabaseHandler.java b/src/main/java/world/bentobox/bentobox/database/mariadb/MariaDBDatabaseHandler.java index 87a1169ba..c215c75d2 100644 --- a/src/main/java/world/bentobox/bentobox/database/mariadb/MariaDBDatabaseHandler.java +++ b/src/main/java/world/bentobox/bentobox/database/mariadb/MariaDBDatabaseHandler.java @@ -272,13 +272,6 @@ public class MariaDBDatabaseHandler extends AbstractJSONDatabaseHandler { @Override public void close() { - if (connection != null) { - try { - connection.close(); - } catch (SQLException e) { - plugin.logError("Could not close database for some reason"); - } - } + databaseConnector.closeConnection(); } - } diff --git a/src/main/java/world/bentobox/bentobox/database/mongodb/MongoDBDatabaseHandler.java b/src/main/java/world/bentobox/bentobox/database/mongodb/MongoDBDatabaseHandler.java index f619f2a14..b722a39ab 100644 --- a/src/main/java/world/bentobox/bentobox/database/mongodb/MongoDBDatabaseHandler.java +++ b/src/main/java/world/bentobox/bentobox/database/mongodb/MongoDBDatabaseHandler.java @@ -147,8 +147,5 @@ public class MongoDBDatabaseHandler extends AbstractJSONDatabaseHandler { @Override public void close() { dbConnecter.closeConnection(); - } - - } diff --git a/src/main/java/world/bentobox/bentobox/database/mysql/MySQLDatabaseHandler.java b/src/main/java/world/bentobox/bentobox/database/mysql/MySQLDatabaseHandler.java index 55033a0cf..4d23b0705 100644 --- a/src/main/java/world/bentobox/bentobox/database/mysql/MySQLDatabaseHandler.java +++ b/src/main/java/world/bentobox/bentobox/database/mysql/MySQLDatabaseHandler.java @@ -273,13 +273,6 @@ public class MySQLDatabaseHandler extends AbstractJSONDatabaseHandler { @Override public void close() { - if (connection != null) { - try { - connection.close(); - } catch (SQLException e) { - plugin.logError("Could not close database for some reason"); - } - } + databaseConnector.closeConnection(); } - }