diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java index ab0c6bbe9fa1..844363c06413 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java @@ -666,8 +666,9 @@ public Map getDatabases(Integer datasourceId) { } if (dataSource.getType() == DbType.POSTGRESQL) { rs = connection.createStatement().executeQuery(Constants.DATABASES_QUERY_PG); + } else { + rs = connection.createStatement().executeQuery(Constants.DATABASES_QUERY); } - rs = connection.createStatement().executeQuery(Constants.DATABASES_QUERY); tableList = new ArrayList<>(); while (rs.next()) { String name = rs.getString(1);