Fixed database not finding driver
This commit is contained in:
parent
f5519811ed
commit
be26ab2d7e
|
|
@ -22,6 +22,12 @@ public class DatabaseConnection {
|
||||||
if (this.connection == null || this.connection.isClosed()) {
|
if (this.connection == null || this.connection.isClosed()) {
|
||||||
synchronized(this) {
|
synchronized(this) {
|
||||||
if (this.connection == null || this.connection.isClosed()) {
|
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:"
|
this.connection = DriverManager.getConnection("jdbc:"
|
||||||
+ Config.DRIVERS + "://"
|
+ Config.DRIVERS + "://"
|
||||||
+ Config.IP + ":"
|
+ Config.IP + ":"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user