mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-23 10:45:23 +01:00
Specify the Driver Class Name ("com.mysql.cj.jdbc.Driver") (#2262)
* Specify the Driver Class Name ("com.mysql.cj.jdbc.Driver") TODO: Configurable Driver Class Name * Update DatabaseSettings.java * Update MySQL.java
This commit is contained in:
parent
f6392d2d5c
commit
f2bdaa0454
@ -43,6 +43,7 @@ public class MySQL extends AbstractSqlDataSource {
|
||||
private String port;
|
||||
private String username;
|
||||
private String password;
|
||||
private String className;
|
||||
private String database;
|
||||
private String tableName;
|
||||
private int poolSize;
|
||||
@ -99,6 +100,7 @@ public class MySQL extends AbstractSqlDataSource {
|
||||
this.port = settings.getProperty(DatabaseSettings.MYSQL_PORT);
|
||||
this.username = settings.getProperty(DatabaseSettings.MYSQL_USERNAME);
|
||||
this.password = settings.getProperty(DatabaseSettings.MYSQL_PASSWORD);
|
||||
this.className = settings.getProperty(DatabaseSettings.MYSQL_DRIVER_CLASS_NAME);
|
||||
this.database = settings.getProperty(DatabaseSettings.MYSQL_DATABASE);
|
||||
this.tableName = settings.getProperty(DatabaseSettings.MYSQL_TABLE);
|
||||
this.columnOthers = settings.getProperty(HooksSettings.MYSQL_OTHER_USERNAME_COLS);
|
||||
@ -128,6 +130,9 @@ public class MySQL extends AbstractSqlDataSource {
|
||||
// Auth
|
||||
ds.setUsername(this.username);
|
||||
ds.setPassword(this.password);
|
||||
|
||||
// Driver
|
||||
ds.setDriverClassName(this.className);
|
||||
|
||||
// Request mysql over SSL
|
||||
ds.addDataSourceProperty("useSSL", String.valueOf(useSsl));
|
||||
|
@ -44,6 +44,10 @@ public final class DatabaseSettings implements SettingsHolder {
|
||||
@Comment("Password to connect to the MySQL database")
|
||||
public static final Property<String> MYSQL_PASSWORD =
|
||||
newProperty("DataSource.mySQLPassword", "12345");
|
||||
|
||||
@Comment("Driver Name of the MySQL database")
|
||||
public static final Property<String> MYSQL_DRIVER_CLASS_NAME =
|
||||
newProperty("DataSource.mySQLDriverClassName", "com.mysql.cj.jdbc.Driver");
|
||||
|
||||
@Comment("Database Name, use with converters or as SQLITE database name")
|
||||
public static final Property<String> MYSQL_DATABASE =
|
||||
|
Loading…
Reference in New Issue
Block a user