Use DatabaseConnector#closeConnection() instead of duplicating code in database handlers

This commit is contained in:
Florian CUNY 2019-06-27 14:19:26 +02:00
parent 195eac09cf
commit 544bda4e01
3 changed files with 2 additions and 19 deletions

View File

@ -272,13 +272,6 @@ public class MariaDBDatabaseHandler<T> extends AbstractJSONDatabaseHandler<T> {
@Override @Override
public void close() { public void close() {
if (connection != null) { databaseConnector.closeConnection();
try {
connection.close();
} catch (SQLException e) {
plugin.logError("Could not close database for some reason");
}
}
} }
} }

View File

@ -147,8 +147,5 @@ public class MongoDBDatabaseHandler<T> extends AbstractJSONDatabaseHandler<T> {
@Override @Override
public void close() { public void close() {
dbConnecter.closeConnection(); dbConnecter.closeConnection();
} }
} }

View File

@ -273,13 +273,6 @@ public class MySQLDatabaseHandler<T> extends AbstractJSONDatabaseHandler<T> {
@Override @Override
public void close() { public void close() {
if (connection != null) { databaseConnector.closeConnection();
try {
connection.close();
} catch (SQLException e) {
plugin.logError("Could not close database for some reason");
}
}
} }
} }