From c1d56d5ee52286870ff7c1ba363b99f9d5e8e881 Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Tue, 8 Sep 2015 17:33:52 +0200 Subject: [PATCH] Fix hikari for mysql and sqlite --- src/main/java/fr/xephi/authme/PerformBackup.java | 5 ++--- src/main/java/fr/xephi/authme/datasource/MySQL.java | 1 - src/main/java/fr/xephi/authme/datasource/SQLite_HIKARI.java | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/fr/xephi/authme/PerformBackup.java b/src/main/java/fr/xephi/authme/PerformBackup.java index 71a69f04a..556ece3c9 100644 --- a/src/main/java/fr/xephi/authme/PerformBackup.java +++ b/src/main/java/fr/xephi/authme/PerformBackup.java @@ -35,13 +35,12 @@ public class PerformBackup { switch (Settings.getDataSource) { case FILE: return FileBackup("auths.db"); - case MYSQL: return MySqlBackup(); - case SQLITE: return FileBackup(Settings.getMySQLDatabase + ".db"); - + case SQLITEHIKARI: + return FileBackup(Settings.getMySQLDatabase + ".db"); } return false; diff --git a/src/main/java/fr/xephi/authme/datasource/MySQL.java b/src/main/java/fr/xephi/authme/datasource/MySQL.java index 9ffbf64ee..e477ea4da 100644 --- a/src/main/java/fr/xephi/authme/datasource/MySQL.java +++ b/src/main/java/fr/xephi/authme/datasource/MySQL.java @@ -37,7 +37,6 @@ public class MySQL implements DataSource { private List columnOthers; private HikariDataSource ds; private String columnRealName; - private Connection connection; public MySQL() throws ClassNotFoundException, SQLException, PoolInitializationException { this.host = Settings.getMySQLHost; diff --git a/src/main/java/fr/xephi/authme/datasource/SQLite_HIKARI.java b/src/main/java/fr/xephi/authme/datasource/SQLite_HIKARI.java index 9ac800553..602dec5f8 100644 --- a/src/main/java/fr/xephi/authme/datasource/SQLite_HIKARI.java +++ b/src/main/java/fr/xephi/authme/datasource/SQLite_HIKARI.java @@ -122,7 +122,8 @@ public class SQLite_HIKARI implements DataSource { throws ClassNotFoundException, IllegalArgumentException { HikariConfig config = new HikariConfig(); config.setPoolName("AuthMeSQLitePool"); - config.setDataSourceClassName("org.sqlite.SQLiteDataSource"); + config.setDriverClassName("org.sqlite.JDBC"); + config.setDataSourceClassName("org.sqlite.javax.SQLiteConnectionPoolDataSource"); config.setJdbcUrl("jdbc:sqlite:plugins/AuthMe/" + database + ".db"); config.setInitializationFailFast(true); // Don't start the plugin if the database is unavariable config.setConnectionTestQuery("SELECT 1");