Fixed database not finding driver

This commit is contained in:
Teriuihi 2022-02-13 19:34:43 +01:00
parent f5519811ed
commit be26ab2d7e

View File

@ -22,6 +22,12 @@ public class DatabaseConnection {
if (this.connection == null || this.connection.isClosed()) {
synchronized(this) {
if (this.connection == null || this.connection.isClosed()) {
try {
Class.forName("com.mysql.cj.jdbc.Driver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
this.connection = DriverManager.getConnection("jdbc:"
+ Config.DRIVERS + "://"
+ Config.IP + ":"