diff --git a/Plan/common/src/main/java/com/djrapitops/plan/storage/database/MySQLDB.java b/Plan/common/src/main/java/com/djrapitops/plan/storage/database/MySQLDB.java index c5a963258..3c2434ff2 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/storage/database/MySQLDB.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/storage/database/MySQLDB.java @@ -38,7 +38,6 @@ import javax.inject.Singleton; import javax.sql.DataSource; import java.sql.Connection; import java.sql.SQLException; -import java.sql.Statement; import java.util.Objects; import java.util.concurrent.TimeUnit; @@ -107,6 +106,7 @@ public class MySQLDB extends SQLDB { hikariConfig.setUsername(username); hikariConfig.setPassword(password); + hikariConfig.addDataSourceProperty("connectionInitSql", "set time_zone = '+00:00'"); hikariConfig.setPoolName("Plan Connection Pool-" + increment); increment(); @@ -139,16 +139,9 @@ public class MySQLDB extends SQLDB { } } if (connection.getAutoCommit()) connection.setAutoCommit(false); - setTimezoneToUTC(connection); return connection; } - private void setTimezoneToUTC(Connection connection) throws SQLException { - try (Statement statement = connection.createStatement()) { - statement.execute("set time_zone = '+00:00'"); - } - } - @Override public void close() { super.close();