[FIX-#6505][Dao] upgrade the MySQL driver package for building MySQL jdbcUrl (#6708)
* replace com.mysql.jdbc.Driver everywhere with com.mysql.cj.jdbc.Driver
This commit is contained in:
parent
653eae2419
commit
861aaaf971
|
|
@ -57,7 +57,7 @@ dolphin_database_config['dolphin_database_type'] = dolphin_env_map['dolphin.data
|
|||
dolphin_database_config['dolphin_database_username'] = dolphin_env_map['dolphin.database.username']
|
||||
dolphin_database_config['dolphin_database_password'] = dolphin_env_map['dolphin.database.password']
|
||||
if 'mysql' == dolphin_database_config['dolphin_database_type']:
|
||||
dolphin_database_config['dolphin_database_driver'] = 'com.mysql.jdbc.Driver'
|
||||
dolphin_database_config['dolphin_database_driver'] = 'com.mysql.cj.jdbc.Driver'
|
||||
dolphin_database_config['driverDelegateClass'] = 'org.quartz.impl.jdbcjobstore.StdJDBCDelegate'
|
||||
dolphin_database_config['dolphin_database_url'] = 'jdbc:mysql://' + dolphin_env_map['dolphin.database.host'] \
|
||||
+ ':' + dolphin_env_map['dolphin.database.port'] \
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ dolphin_database_config['dolphin_database_type'] = dolphin_env_map['dolphin.data
|
|||
dolphin_database_config['dolphin_database_username'] = dolphin_env_map['dolphin.database.username']
|
||||
dolphin_database_config['dolphin_database_password'] = dolphin_env_map['dolphin.database.password']
|
||||
if 'mysql' == dolphin_database_config['dolphin_database_type']:
|
||||
dolphin_database_config['dolphin_database_driver'] = 'com.mysql.jdbc.Driver'
|
||||
dolphin_database_config['dolphin_database_driver'] = 'com.mysql.cj.jdbc.Driver'
|
||||
dolphin_database_config['driverDelegateClass'] = 'org.quartz.impl.jdbcjobstore.StdJDBCDelegate'
|
||||
dolphin_database_config['dolphin_database_url'] = 'jdbc:mysql://' + dolphin_env_map['dolphin.database.host'] \
|
||||
+ ':' + dolphin_env_map['dolphin.database.port'] \
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ DATABASE_DATABASE=dolphinscheduler
|
|||
DATABASE_PARAMS=characterEncoding=utf8
|
||||
# mysql
|
||||
# DATABASE_TYPE=mysql
|
||||
# DATABASE_DRIVER=com.mysql.jdbc.Driver
|
||||
# DATABASE_DRIVER=com.mysql.cj.jdbc.Driver
|
||||
# DATABASE_HOST=dolphinscheduler-mysql
|
||||
# DATABASE_PORT=3306
|
||||
# DATABASE_USERNAME=root
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ public class DataSourceServiceTest {
|
|||
mysqlDatasourceParamDTO.setOther(other);
|
||||
ConnectionParam connectionParam = DatasourceUtil.buildConnectionParams(mysqlDatasourceParamDTO);
|
||||
String expected = "{\"user\":\"test\",\"password\":\"IUAjJCVeJipNVEl6TkRVMg==\",\"address\":\"jdbc:mysql://192.168.9.1:1521\",\"database\":\"im\",\"jdbcUrl\":\"jdbc:mysql://192.168.9.1:1521/"
|
||||
+ "im\",\"driverClassName\":\"com.mysql.jdbc.Driver\",\"validationQuery\":\"select 1\",\"props\":{\"autoDeserialize\":\"yes\",\"allowUrlInLocalInfile\":\"true\"}}";
|
||||
+ "im\",\"driverClassName\":\"com.mysql.cj.jdbc.Driver\",\"validationQuery\":\"select 1\",\"props\":{\"autoDeserialize\":\"yes\",\"allowUrlInLocalInfile\":\"true\"}}";
|
||||
Assert.assertEquals(expected, JSONUtils.toJsonString(connectionParam));
|
||||
|
||||
PropertyUtils.setValue(Constants.DATASOURCE_ENCRYPTION_ENABLE, "false");
|
||||
|
|
@ -362,7 +362,7 @@ public class DataSourceServiceTest {
|
|||
mysqlDatasourceParamDTO.setPassword("123456");
|
||||
connectionParam = DatasourceUtil.buildConnectionParams(mysqlDatasourceParamDTO);
|
||||
expected = "{\"user\":\"test\",\"password\":\"123456\",\"address\":\"jdbc:mysql://192.168.9.1:1521\",\"database\":\"im\","
|
||||
+ "\"jdbcUrl\":\"jdbc:mysql://192.168.9.1:1521/im\",\"driverClassName\":\"com.mysql.jdbc.Driver\",\"validationQuery\":\"select 1\"}";
|
||||
+ "\"jdbcUrl\":\"jdbc:mysql://192.168.9.1:1521/im\",\"driverClassName\":\"com.mysql.cj.jdbc.Driver\",\"validationQuery\":\"select 1\"}";
|
||||
Assert.assertEquals(expected, JSONUtils.toJsonString(connectionParam));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public class MysqlDatasourceProcessor extends AbstractDatasourceProcessor {
|
|||
|
||||
@Override
|
||||
public String getDatasourceDriver() {
|
||||
return Constants.COM_MYSQL_JDBC_DRIVER;
|
||||
return Constants.COM_MYSQL_CJ_JDBC_DRIVER;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public class MysqlDatasourceProcessorTest {
|
|||
|
||||
@Test
|
||||
public void testGetDatasourceDriver() {
|
||||
Assert.assertEquals(Constants.COM_MYSQL_JDBC_DRIVER, mysqlDatasourceProcessor.getDatasourceDriver());
|
||||
Assert.assertEquals(Constants.COM_MYSQL_CJ_JDBC_DRIVER, mysqlDatasourceProcessor.getDatasourceDriver());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ public class TaskConstants {
|
|||
* driver
|
||||
*/
|
||||
public static final String ORG_POSTGRESQL_DRIVER = "org.postgresql.Driver";
|
||||
public static final String COM_MYSQL_JDBC_DRIVER = "com.mysql.jdbc.Driver";
|
||||
public static final String COM_MYSQL_CJ_JDBC_DRIVER = "com.mysql.cj.jdbc.Driver";
|
||||
public static final String ORG_APACHE_HIVE_JDBC_HIVE_DRIVER = "org.apache.hive.jdbc.HiveDriver";
|
||||
public static final String COM_CLICKHOUSE_JDBC_DRIVER = "ru.yandex.clickhouse.ClickHouseDriver";
|
||||
public static final String COM_ORACLE_JDBC_DRIVER = "oracle.jdbc.driver.OracleDriver";
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ public class Constants {
|
|||
* driver
|
||||
*/
|
||||
public static final String ORG_POSTGRESQL_DRIVER = "org.postgresql.Driver";
|
||||
public static final String COM_MYSQL_JDBC_DRIVER = "com.mysql.jdbc.Driver";
|
||||
public static final String COM_MYSQL_CJ_JDBC_DRIVER = "com.mysql.cj.jdbc.Driver";
|
||||
public static final String ORG_APACHE_HIVE_JDBC_HIVE_DRIVER = "org.apache.hive.jdbc.HiveDriver";
|
||||
public static final String COM_CLICKHOUSE_JDBC_DRIVER = "ru.yandex.clickhouse.ClickHouseDriver";
|
||||
public static final String COM_ORACLE_JDBC_DRIVER = "oracle.jdbc.OracleDriver";
|
||||
|
|
|
|||
Loading…
Reference in New Issue