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) {
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;

View File

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

View File

@ -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");