Add missing "MARIADB" datasource backend to the configuration file, remove "mySQLDriverClassName" property as it is no longer needed.
This commit is contained in:
@@ -44,7 +44,6 @@ 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;
|
||||
@@ -90,6 +89,15 @@ public class MySQL extends AbstractSqlDataSource {
|
||||
setParameters(settings, extensionsFactory);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the path of the Driver class to use when connecting to the database.
|
||||
*
|
||||
* @return the dotted path of the SQL driver class to be used
|
||||
*/
|
||||
protected String getDriverClassName() {
|
||||
return "com.mysql.cj.jdbc.Driver";
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves various settings.
|
||||
*
|
||||
@@ -101,14 +109,6 @@ 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);
|
||||
try {
|
||||
Class.forName(this.className);
|
||||
} catch (ClassNotFoundException e) {
|
||||
this.className = DatabaseSettings.MYSQL_DRIVER_CLASS_NAME.getDefaultValue();
|
||||
logger.info("Driver class '" + this.className + "' not found! Falling back to the built-in MySQL driver ("
|
||||
+ this.className + ")");
|
||||
}
|
||||
this.database = settings.getProperty(DatabaseSettings.MYSQL_DATABASE);
|
||||
this.tableName = settings.getProperty(DatabaseSettings.MYSQL_TABLE);
|
||||
this.columnOthers = settings.getProperty(HooksSettings.MYSQL_OTHER_USERNAME_COLS);
|
||||
@@ -141,7 +141,7 @@ public class MySQL extends AbstractSqlDataSource {
|
||||
ds.setPassword(this.password);
|
||||
|
||||
// Driver
|
||||
ds.setDriverClassName(this.className);
|
||||
ds.setDriverClassName(this.getDriverClassName());
|
||||
|
||||
// Request mysql over SSL
|
||||
ds.addDataSourceProperty("useSSL", String.valueOf(useSsl));
|
||||
|
||||
Reference in New Issue
Block a user