mirror of
https://github.com/PlayPro/CoreProtect.git
synced 2024-11-25 12:25:37 +01:00
Fixed SQLException when MySQL driver isn't automatically detected (#117)
This commit is contained in:
parent
64188f5a75
commit
8ed4216c64
@ -210,6 +210,14 @@ public class ConfigHandler extends Queue {
|
||||
}
|
||||
else {
|
||||
HikariConfig config = new HikariConfig();
|
||||
try {
|
||||
Class.forName("com.mysql.cj.jdbc.Driver");
|
||||
config.setDriverClassName("com.mysql.cj.jdbc.Driver");
|
||||
}
|
||||
catch (Exception e) {
|
||||
config.setDriverClassName("com.mysql.jdbc.Driver");
|
||||
}
|
||||
|
||||
config.setJdbcUrl("jdbc:mysql://" + ConfigHandler.host + ":" + ConfigHandler.port + "/" + ConfigHandler.database);
|
||||
config.setUsername(ConfigHandler.username);
|
||||
config.setPassword(ConfigHandler.password);
|
||||
|
Loading…
Reference in New Issue
Block a user