Fixed SQLException when MySQL driver isn't automatically detected (#117)

This commit is contained in:
Intelli 2022-01-04 16:32:30 -07:00
parent 64188f5a75
commit 8ed4216c64

View File

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