Register SQL drivers before Hikari loads

This commit is contained in:
egg82 2018-11-28 23:19:03 -07:00
parent 68b8f62454
commit 0db46a257e

View File

@ -85,7 +85,11 @@ public class BukkitBootstrap extends SanePlugin implements ISaneEconomy {
JarUtil.loadJar("http://central.maven.org/maven2/org/xerial/sqlite-jdbc/3.25.2/sqlite-jdbc-3.25.2.jar", JarUtil.loadJar("http://central.maven.org/maven2/org/xerial/sqlite-jdbc/3.25.2/sqlite-jdbc-3.25.2.jar",
new File(jarsFolder, "sqlite-jdbc-3.25.2.jar"), new File(jarsFolder, "sqlite-jdbc-3.25.2.jar"),
classLoader); classLoader);
}
try {
DriverManager.getDriver("org.sqlite.JDBC");
} catch (SQLException ignored) {
try { try {
DriverManager.registerDriver((Driver) Class.forName("org.sqlite.JDBC", true, classLoader).newInstance()); DriverManager.registerDriver((Driver) Class.forName("org.sqlite.JDBC", true, classLoader).newInstance());
} catch (ClassNotFoundException | InstantiationException | SQLException ex) { } catch (ClassNotFoundException | InstantiationException | SQLException ex) {
@ -100,7 +104,11 @@ public class BukkitBootstrap extends SanePlugin implements ISaneEconomy {
JarUtil.loadJar("http://central.maven.org/maven2/mysql/mysql-connector-java/8.0.13/mysql-connector-java-8.0.13.jar", JarUtil.loadJar("http://central.maven.org/maven2/mysql/mysql-connector-java/8.0.13/mysql-connector-java-8.0.13.jar",
new File(jarsFolder, "mysql-connector-java-8.0.13.jar"), new File(jarsFolder, "mysql-connector-java-8.0.13.jar"),
classLoader); classLoader);
}
try {
DriverManager.getDriver("com.mysql.jdbc.Driver");
} catch (SQLException ignored) {
try { try {
DriverManager.registerDriver((Driver) Class.forName("com.mysql.jdbc.Driver", true, classLoader).newInstance()); DriverManager.registerDriver((Driver) Class.forName("com.mysql.jdbc.Driver", true, classLoader).newInstance());
} catch (ClassNotFoundException | InstantiationException | SQLException ex) { } catch (ClassNotFoundException | InstantiationException | SQLException ex) {