Fix hikari for mysql and sqlite

This commit is contained in:
Gabriele C 2015-09-08 17:33:52 +02:00
parent e2b3c51cab
commit c1d56d5ee5
3 changed files with 4 additions and 5 deletions

View File

@ -35,13 +35,12 @@ public class PerformBackup {
switch (Settings.getDataSource) { switch (Settings.getDataSource) {
case FILE: case FILE:
return FileBackup("auths.db"); return FileBackup("auths.db");
case MYSQL: case MYSQL:
return MySqlBackup(); return MySqlBackup();
case SQLITE: case SQLITE:
return FileBackup(Settings.getMySQLDatabase + ".db"); return FileBackup(Settings.getMySQLDatabase + ".db");
case SQLITEHIKARI:
return FileBackup(Settings.getMySQLDatabase + ".db");
} }
return false; return false;

View File

@ -37,7 +37,6 @@ public class MySQL implements DataSource {
private List<String> columnOthers; private List<String> columnOthers;
private HikariDataSource ds; private HikariDataSource ds;
private String columnRealName; private String columnRealName;
private Connection connection;
public MySQL() throws ClassNotFoundException, SQLException, PoolInitializationException { public MySQL() throws ClassNotFoundException, SQLException, PoolInitializationException {
this.host = Settings.getMySQLHost; this.host = Settings.getMySQLHost;

View File

@ -122,7 +122,8 @@ public class SQLite_HIKARI implements DataSource {
throws ClassNotFoundException, IllegalArgumentException { throws ClassNotFoundException, IllegalArgumentException {
HikariConfig config = new HikariConfig(); HikariConfig config = new HikariConfig();
config.setPoolName("AuthMeSQLitePool"); 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.setJdbcUrl("jdbc:sqlite:plugins/AuthMe/" + database + ".db");
config.setInitializationFailFast(true); // Don't start the plugin if the database is unavariable config.setInitializationFailFast(true); // Don't start the plugin if the database is unavariable
config.setConnectionTestQuery("SELECT 1"); config.setConnectionTestQuery("SELECT 1");