mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-09 04:02:10 +01:00
Fix hikari for mysql and sqlite
This commit is contained in:
parent
e2b3c51cab
commit
c1d56d5ee5
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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");
|
||||||
|
Loading…
Reference in New Issue
Block a user