diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-db2/src/main/java/org/apache/dolphinscheduler/plugin/datasource/db2/param/Db2DataSourceProcessor.java b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-db2/src/main/java/org/apache/dolphinscheduler/plugin/datasource/db2/param/Db2DataSourceProcessor.java index 02b1bb5602..ab35f6a841 100644 --- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-db2/src/main/java/org/apache/dolphinscheduler/plugin/datasource/db2/param/Db2DataSourceProcessor.java +++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-db2/src/main/java/org/apache/dolphinscheduler/plugin/datasource/db2/param/Db2DataSourceProcessor.java @@ -54,7 +54,7 @@ public class Db2DataSourceProcessor extends AbstractDataSourceProcessor { Db2DataSourceParamDTO db2DatasourceParamDTO = new Db2DataSourceParamDTO(); db2DatasourceParamDTO.setDatabase(connectionParams.getDatabase()); db2DatasourceParamDTO.setOther(connectionParams.getOther()); - db2DatasourceParamDTO.setUserName(db2DatasourceParamDTO.getUserName()); + db2DatasourceParamDTO.setUserName(connectionParams.getUser()); String[] hostSeperator = connectionParams.getAddress().split(Constants.DOUBLE_SLASH); String[] hostPortArray = hostSeperator[hostSeperator.length - 1].split(Constants.COMMA); @@ -97,7 +97,7 @@ public class Db2DataSourceProcessor extends AbstractDataSourceProcessor { public String getJdbcUrl(ConnectionParam connectionParam) { Db2ConnectionParam db2ConnectionParam = (Db2ConnectionParam) connectionParam; if (MapUtils.isNotEmpty(db2ConnectionParam.getOther())) { - return String.format("%s;%s", db2ConnectionParam.getJdbcUrl(), + return String.format("%s:%s", db2ConnectionParam.getJdbcUrl(), transformOther(db2ConnectionParam.getOther())); } return db2ConnectionParam.getJdbcUrl(); diff --git a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-db2/src/test/java/org/apache/dolphinscheduler/plugin/datasource/db2/param/Db2DataSourceProcessorTest.java b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-db2/src/test/java/org/apache/dolphinscheduler/plugin/datasource/db2/param/Db2DataSourceProcessorTest.java index ea04ece189..d5289afcf2 100644 --- a/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-db2/src/test/java/org/apache/dolphinscheduler/plugin/datasource/db2/param/Db2DataSourceProcessorTest.java +++ b/dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-db2/src/test/java/org/apache/dolphinscheduler/plugin/datasource/db2/param/Db2DataSourceProcessorTest.java @@ -85,7 +85,7 @@ public class Db2DataSourceProcessorTest { .build(); db2ConnectionParam.setOther(map); String jdbcUrl = db2DatasourceProcessor.getJdbcUrl(db2ConnectionParam); - Assertions.assertEquals("jdbc:db2://localhost:5142/default;other=other", jdbcUrl); + Assertions.assertEquals("jdbc:db2://localhost:5142/default:other=other", jdbcUrl); } @Test