mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-22 02:12:25 +00:00
Specify database connection test queries
Should fix database connection error on older Minecraft versions
This commit is contained in:
parent
6962ad995e
commit
404c872396
@ -24,6 +24,7 @@ public class MySQL extends Database {
|
|||||||
Config.databaseMySqlHost, Config.databaseMySqlPort, Config.databaseMySqlDatabase));
|
Config.databaseMySqlHost, Config.databaseMySqlPort, Config.databaseMySqlDatabase));
|
||||||
config.setUsername(Config.databaseMySqlUsername);
|
config.setUsername(Config.databaseMySqlUsername);
|
||||||
config.setPassword(Config.databaseMySqlPassword);
|
config.setPassword(Config.databaseMySqlPassword);
|
||||||
|
config.setConnectionTestQuery("SELECT 1");
|
||||||
|
|
||||||
return new HikariDataSource(config);
|
return new HikariDataSource(config);
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ public class SQLite extends Database {
|
|||||||
|
|
||||||
HikariConfig config = new HikariConfig();
|
HikariConfig config = new HikariConfig();
|
||||||
config.setJdbcUrl(String.format("jdbc:sqlite:" + dbFile));
|
config.setJdbcUrl(String.format("jdbc:sqlite:" + dbFile));
|
||||||
|
config.setConnectionTestQuery("SELECT 1");
|
||||||
|
|
||||||
return new HikariDataSource(config);
|
return new HikariDataSource(config);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user