Load the new mysql driver class if available

This commit is contained in:
Brokkonaut
2021-04-13 18:32:16 +02:00
parent c20b677507
commit 0fd3266c7b

View File

@ -73,7 +73,11 @@ public class LogBlock extends JavaPlugin {
}
try {
getLogger().info("Connecting to " + user + "@" + url + "...");
Class.forName("com.mysql.jdbc.Driver");
try {
Class.forName("com.mysql.cj.jdbc.Driver");
} catch (ClassNotFoundException ignored) {
Class.forName("com.mysql.jdbc.Driver");
}
pool = new MySQLConnectionPool(url, user, password, mysqlUseSSL, mysqlRequireSSL);
final Connection conn = getConnection(true);
if (conn == null) {