mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-27 13:15:28 +01:00
Use DatabaseConnector#closeConnection() instead of duplicating code in database handlers
This commit is contained in:
parent
195eac09cf
commit
544bda4e01
@ -272,13 +272,6 @@ public class MariaDBDatabaseHandler<T> extends AbstractJSONDatabaseHandler<T> {
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
if (connection != null) {
|
||||
try {
|
||||
connection.close();
|
||||
} catch (SQLException e) {
|
||||
plugin.logError("Could not close database for some reason");
|
||||
}
|
||||
}
|
||||
databaseConnector.closeConnection();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -147,8 +147,5 @@ public class MongoDBDatabaseHandler<T> extends AbstractJSONDatabaseHandler<T> {
|
||||
@Override
|
||||
public void close() {
|
||||
dbConnecter.closeConnection();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -273,13 +273,6 @@ public class MySQLDatabaseHandler<T> extends AbstractJSONDatabaseHandler<T> {
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
if (connection != null) {
|
||||
try {
|
||||
connection.close();
|
||||
} catch (SQLException e) {
|
||||
plugin.logError("Could not close database for some reason");
|
||||
}
|
||||
}
|
||||
databaseConnector.closeConnection();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user