From 69b5c904332165312b0ee31baf37cadcbfb5edb8 Mon Sep 17 00:00:00 2001 From: qiucong Date: Wed, 4 Nov 2020 15:32:46 +0800 Subject: [PATCH 1/5] =?UTF-8?q?DEC-15719=20feat:=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E7=9B=B4=E6=8E=A5=E6=94=AF=E6=8C=81jdbc?= =?UTF-8?q?=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/__test__/app.test.ts | 2 + src/modules/app.provider.ts | 64 +++++++++++++++++++ src/modules/app.service.ts | 58 +++-------------- .../connection_jdbc/connection_jdbc.ts | 2 +- .../maintain/forms/components/form.jdbc.ts | 6 +- 5 files changed, 79 insertions(+), 53 deletions(-) diff --git a/src/modules/__test__/app.test.ts b/src/modules/__test__/app.test.ts index d1a205f..2416310 100644 --- a/src/modules/__test__/app.test.ts +++ b/src/modules/__test__/app.test.ts @@ -1,4 +1,6 @@ import { connectionCanEdit, resolveUrlInfo, splitUrl, getJdbcDatabaseType } from '../app.service'; +import '../app.provider'; + const connection = { connectionId: '', connectionType: '', diff --git a/src/modules/app.provider.ts b/src/modules/app.provider.ts index af4542a..97f6753 100644 --- a/src/modules/app.provider.ts +++ b/src/modules/app.provider.ts @@ -1,9 +1,73 @@ import { CONSTANT_PLUGIN_TYPES } from './app.constant'; BI.provider('dec.connection.provider.datebase', function() { + this.resolves = {}; + + // 原service中resolveUrlInfo方法 + function jdbcResolve (url: string) { + if (BI.isNull(url)) return {}; + const oracleUlr = url.match(/^jdbc:(oracle):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(:|\/)([^]+)(.*)/i); + if (oracleUlr) { + return { + host: oracleUlr[5], + port: oracleUlr[7] === 'port' ? '' : oracleUlr[7], + databaseName: oracleUlr[9], + urlInfo: oracleUlr[10], + }; + } + + const greenplumUrl = url.match(/^jdbc:(pivotal:greenplum):(thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;)([^]+)(.*)/i); + if (greenplumUrl) { + return { + host: greenplumUrl[4], + port: greenplumUrl[6] === 'port' ? '' : greenplumUrl[6], + databaseName: greenplumUrl[8], + urlInfo: greenplumUrl[9], + }; + } + const result = url.match(/^jdbc:(mysql|sqlserver|db2|impala|kylin|phoenix|derby|gbase|gbasedbt-sqli|informix-sqli|h2|postgresql|hive2|vertica|kingbase|presto|redshift|postgresql|clickhouse):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;DatabaseName=)?([^]+)?(.*)/i); + if (result) { + return { + host: result[5], + port: result[7] === 'port' ? '' : result[7], + databaseName: result[9] || '', + urlInfo: result[10], + }; + } + + // 处理oracle的RAC方式 + if (/^jdbc:oracle:thin:([0-9a-zA-Z/]*)?@\(DESCRIPTION/i.test(url)) { + const host = url.match(/\(HOST\s*=\s*([0-9a-zA-Z_\\.-]+)\)/i); + const port = url.match(/\(PORT\s*=\s*([0-9]+)\)/i); + const databaseName = url.match(/\(SERVICE_NAME\s*=\s*([\s0-9a-zA-Z_\\.]+)\)/i); + + return { + host: host ? host[1] : '', + port: port && port[1] !== 'port' ? port[1] : '', + databaseName: databaseName ? databaseName[1] : '', + urlInfo: '', + }; + } + + return { + host: '', + port: '', + databaseName: '', + urlInfo: '', + }; + } + this.registerDatabaseType = (config: any) => { BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, config)); }; + + this.registerJdbcDatabase = (config: any, resolve?: Function) => { + BI.config(CONSTANT_PLUGIN_TYPES, connections => BI.concat(connections, { ...config, type: 'jdbc' })); + + BI.isFunction(resolve) && (this.resolves[config.databaseType] = resolve); + }; + this.$get = () => BI.inherit(BI.OB, { + getJdbcResolveByType: (type: string) => this.resolves[type] || jdbcResolve, }); }); diff --git a/src/modules/app.service.ts b/src/modules/app.service.ts index 50728d6..0014d28 100644 --- a/src/modules/app.service.ts +++ b/src/modules/app.service.ts @@ -31,14 +31,16 @@ export function getJdbcDatabaseType(database: string, driver: string): DatabaseT return DATA_BASE_TYPES_OTHER; } let databaseType = null; - // KERNEL-1655 兼容旧版 由于旧版设计器创建的数据连接database都为other,所以要根据driber来判断数据类型 - if (database && database !== 'other' && DATA_BASE_TYPES.some(item => item.databaseType === database)) { - databaseType = DATA_BASE_TYPES.find(item => item.databaseType === database); + // 从全部数据库类型中获取jdbc类型的 + const jdbcDatabases = getAllDatabaseTypes().filter(v => v.type === 'jdbc'); + // KERNEL-1655 兼容旧版 由于旧版设计器创建的数据连接database都为other,所以要根据driver来判断数据类型 + if (database && database !== 'other' && jdbcDatabases.some(item => item.databaseType === database)) { + databaseType = jdbcDatabases.find(item => item.databaseType === database); } else { const designDatabase = DESIGN_DRIVER_TYPE.find(item => item.driver === driver); - const decisionDatabase = DATA_BASE_TYPES.find(item => item.driver === driver); + const decisionDatabase = jdbcDatabases.find(item => item.driver === driver); const type = designDatabase ? BI.get(designDatabase, 'type') : BI.get(decisionDatabase, 'databaseType'); - databaseType = DATA_BASE_TYPES.find(item => item.databaseType === type); + databaseType = jdbcDatabases.find(item => item.databaseType === type); } if (!databaseType) { return DATA_BASE_TYPES_OTHER; @@ -47,52 +49,10 @@ export function getJdbcDatabaseType(database: string, driver: string): DatabaseT return databaseType; } -export function resolveUrlInfo (url: string) { +export function resolveUrlInfo (url: string, database?: string) { if (BI.isNull(url)) return {}; - const oracleUlr = url.match(/^jdbc:(oracle):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(:|\/)([^]+)(.*)/i); - if (oracleUlr) { - return { - host: oracleUlr[5], - port: oracleUlr[7] === 'port' ? '' : oracleUlr[7], - databaseName: oracleUlr[9], - urlInfo: oracleUlr[10], - }; - } - - const greenplumUrl = url.match(/^jdbc:(pivotal:greenplum):(thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;)([^]+)(.*)/i); - if (greenplumUrl) { - return { - host: greenplumUrl[4], - port: greenplumUrl[6] === 'port' ? '' : greenplumUrl[6], - databaseName: greenplumUrl[8], - urlInfo: greenplumUrl[9], - }; - } - const result = url.match(/^jdbc:(mysql|sqlserver|db2|impala|kylin|phoenix|derby|gbase|gbasedbt-sqli|informix-sqli|h2|postgresql|hive2|vertica|kingbase|presto|redshift|postgresql|clickhouse):(thin:([0-9a-zA-Z/]*)?@|thin:([0-9a-zA-Z/]*)?@\/\/|\/\/|)([0-9a-zA-Z_\\.-]+)(:([0-9|port]+))?(\/|;DatabaseName=)?([^]+)?(.*)/i); - if (result) { - return { - host: result[5], - port: result[7] === 'port' ? '' : result[7], - databaseName: result[9] || '', - urlInfo: result[10], - }; - } - - // 处理oracle的RAC方式 - if (/^jdbc:oracle:thin:([0-9a-zA-Z/]*)?@\(DESCRIPTION/i.test(url)) { - const host = url.match(/\(HOST\s*=\s*([0-9a-zA-Z_\\.-]+)\)/i); - const port = url.match(/\(PORT\s*=\s*([0-9]+)\)/i); - const databaseName = url.match(/\(SERVICE_NAME\s*=\s*([\s0-9a-zA-Z_\\.]+)\)/i); - - return { - host: host ? host[1] : '', - port: port && port[1] !== 'port' ? port[1] : '', - databaseName: databaseName ? databaseName[1] : '', - urlInfo: '', - }; - } - return { + return BI.Providers.getProvider('dec.connection.provider.datebase').getJdbcResolveByType(database)(url) || { host: '', port: '', databaseName: '', diff --git a/src/modules/pages/connection/connection_jdbc/connection_jdbc.ts b/src/modules/pages/connection/connection_jdbc/connection_jdbc.ts index 627438d..9d5aa8c 100644 --- a/src/modules/pages/connection/connection_jdbc/connection_jdbc.ts +++ b/src/modules/pages/connection/connection_jdbc/connection_jdbc.ts @@ -19,7 +19,7 @@ export class ConnectionJdbc extends BI.Widget { const connectionData = this.model.connectionSelectedOne.connectionData as ConnectionJDBC; const { driver, database, user, originalCharsetName, schema, connectionPoolAttr, authType, principal, url } = connectionData; const databaseType = getJdbcDatabaseType(database, driver); - const { host, port, databaseName } = resolveUrlInfo(url); + const { host, port, databaseName } = resolveUrlInfo(url, database); const { hgap, vgap } = CONNECTION_LAYOUT; return { diff --git a/src/modules/pages/maintain/forms/components/form.jdbc.ts b/src/modules/pages/maintain/forms/components/form.jdbc.ts index a52a625..f3f8043 100644 --- a/src/modules/pages/maintain/forms/components/form.jdbc.ts +++ b/src/modules/pages/maintain/forms/components/form.jdbc.ts @@ -62,7 +62,7 @@ export class FormJdbc extends BI.Widget { const { initialSize, maxActive, maxIdle, maxWait, validationQuery, testOnBorrow, testOnReturn, testWhileIdle, timeBetweenEvictionRunsMillis, numTestsPerEvictionRun, minIdle, minEvictableIdleTimeMillis } = connectionPoolAttr as ConnectionPoolJDBC; const databaseType = getJdbcDatabaseType(database, driver); this.oldPassword = password; - const { host, port, databaseName } = resolveUrlInfo(url); + const { host, port, databaseName } = resolveUrlInfo(url, database); const { hgap, vgap } = CONNECTION_LAYOUT; const valueRangeConfig = { @@ -112,7 +112,7 @@ export class FormJdbc extends BI.Widget { const connectionType = getJdbcDatabaseType(connectionData.database, connectionData.driver); const url = connectionType.urls ? connectionType.urls[value] : connectionType.url; this.form.url.setValue(url); - const urlInfo = resolveUrlInfo(url); + const urlInfo = resolveUrlInfo(url, connectionData.database); this.form.host.setValue(urlInfo.host); this.form.database.setValue(urlInfo.databaseName); this.form.port.setValue(urlInfo.port); @@ -387,7 +387,7 @@ export class FormJdbc extends BI.Widget { listeners: [{ eventName: 'EVENT_CHANGE', action: () => { - const urlInfo = resolveUrlInfo(this.form.url.getValue()); + const urlInfo = resolveUrlInfo(this.form.url.getValue(), database); this.form.host.setValue(urlInfo.host); this.form.database.setValue(urlInfo.databaseName); this.form.port.setValue(urlInfo.port); From aec03bf7d4ec2a720acf7f7d995f157feef39019 Mon Sep 17 00:00:00 2001 From: qiucong Date: Thu, 5 Nov 2020 16:48:47 +0800 Subject: [PATCH 2/5] =?UTF-8?q?DEC-15747=20feat:=20=E3=80=90BI=E3=80=91ODP?= =?UTF-8?q?S=E6=95=B0=E6=8D=AE=E5=BA=93=E6=94=AF=E6=8C=81=E9=80=82?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/constants/constant.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/constants/constant.ts b/src/modules/constants/constant.ts index c900d05..2ea20bd 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -464,6 +464,17 @@ export const DATA_BASE_TYPES = [ 'org.gjt.mm.mysql.Driver': 'jdbc:mysql://hostname:port/database', }, }, + { + text: 'ODPS', + databaseType: 'odps', + driver: 'com.aliyun.odps.jdbc.OdpsDriver', + url: 'jdbc:odps:?project=', + commonly: false, + internal: true, + type: 'jdbc', + hasSchema: true, + kerberos: false, + }, { text: 'Oracle', databaseType: 'oracle', From b6e8c2c0769524629eaae454274956d9b4c32eba Mon Sep 17 00:00:00 2001 From: qiucong Date: Fri, 6 Nov 2020 14:15:48 +0800 Subject: [PATCH 3/5] =?UTF-8?q?DEC-15759=20&=20DEC-15764=20=E5=B8=AE?= =?UTF-8?q?=E5=8A=A9=E6=96=87=E6=A1=A3=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/scripts/dec.js | 6 +++++- src/modules/constants/constant.ts | 8 ++++++++ src/modules/pages/maintain/forms/form.server.ts | 4 +++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/assets/scripts/dec.js b/assets/scripts/dec.js index 8757f3e..f33b0d6 100644 --- a/assets/scripts/dec.js +++ b/assets/scripts/dec.js @@ -6,6 +6,7 @@ window.DecCst = { LOGIN_INFO_NOT_AVAILABLE: '21300014', LOGIN_INFO_ERROR: '21300018', TIMEOUT: '21300001', + LACK_DRIVER: '22400037' }, Connect: { ConnectionType: { @@ -18,7 +19,9 @@ window.DecCst = { } }, Hyperlink: { - Database: {}, + Database: { + ODPS: "odps" + }, DECISION_HYPERLINK_CONFIG: "hyperlink", WEBSOCKET_CONNECT: "websocket" } @@ -35,6 +38,7 @@ window.Dec = { system: { hyperlink: { websocket: "http://help.finebi.com/doc-view-183.html", + odps: "http://help.finebi.com/doc-view-183.html", }, } } \ No newline at end of file diff --git a/src/modules/constants/constant.ts b/src/modules/constants/constant.ts index 2ea20bd..96c93c1 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -55,6 +55,10 @@ export const DATA_BASE_DRIVER_LINK = DecCst && DecCst.Hyperlink ? [ databaseType: 'derby', link: DecCst.Hyperlink.Database.DERBY, }, + { + databaseType: 'clickhouse', + link: DecCst.Hyperlink.Database.CLICKHOUSE, + }, { databaseType: 'gbase-8a', link: DecCst.Hyperlink.Database.GBASE8A, @@ -123,6 +127,10 @@ export const DATA_BASE_DRIVER_LINK = DecCst && DecCst.Hyperlink ? [ databaseType: 'mysql', link: DecCst.Hyperlink.Database.MYSQL, }, + { + databaseType: 'odps', + link: DecCst.Hyperlink.Database.ODPS, + }, { databaseType: 'oracle', link: DecCst.Hyperlink.Database.ORACLE, diff --git a/src/modules/pages/maintain/forms/form.server.ts b/src/modules/pages/maintain/forms/form.server.ts index e144378..b97bd94 100644 --- a/src/modules/pages/maintain/forms/form.server.ts +++ b/src/modules/pages/maintain/forms/form.server.ts @@ -2,6 +2,7 @@ import { Connection, ConnectionJDBC } from '../../../crud/crud.typings'; import { connectionType, errorCode } from '@constants/env'; import { DATA_BASE_DRIVER_LINK, JDBC_ODBC_DRIVER, JDBC_ODBC_DRIVER_HELP_LINK } from '@constants/constant'; import { TestStatusXtype, EVENT_RELOAD, EVENT_CLOSE } from '../../../components/test_status/test_status'; +import { getJdbcDatabaseType } from '../../../app.service'; import { ApiFactory } from '../../../crud/apiFactory'; const api = new ApiFactory().create(); export function testConnection(value: Connection): Promise { @@ -31,7 +32,8 @@ export function testConnection(value: Connection): Promise { } const databaseType = (formValue.connectionData as ConnectionJDBC).database; const databaseLink = BI.get(DATA_BASE_DRIVER_LINK.find(item => item.databaseType === databaseType), 'link'); - testStatus.setFail(re.errorMsg, driver, Dec.system[DecCst.Hyperlink.DECISION_HYPERLINK_CONFIG][databaseLink]); + const link = Dec.system[DecCst.Hyperlink.DECISION_HYPERLINK_CONFIG][databaseLink] || BI.get(getJdbcDatabaseType(databaseType, driver), 'link'); + testStatus.setFail(re.errorMsg, driver, link); } else { testStatus.setFail(re.errorMsg); } From d0534e8cde322f15c532e1260efecb01d87ff78a Mon Sep 17 00:00:00 2001 From: qiucong Date: Mon, 9 Nov 2020 17:09:00 +0800 Subject: [PATCH 4/5] =?UTF-8?q?DEC-15759=20fix:=20=E3=80=90mysql8=E9=9A=94?= =?UTF-8?q?=E7=A6=BB=E6=8F=92=E4=BB=B6=E3=80=91=E5=B8=AE=E5=8A=A9=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E9=93=BE=E6=8E=A5=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/constants/constant.ts | 2 ++ src/modules/pages/maintain/forms/form.server.ts | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/constants/constant.ts b/src/modules/constants/constant.ts index 96c93c1..0c7549f 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -9,6 +9,8 @@ export const PAGE_INDEX = { export const OTHER_JDBC = 'otherJDBC'; +export const DEFAULT_HELP_LINK = 'databaseHelpLink'; + export const JDBC_ODBC_DRIVER = 'sun.jdbc.odbc.JdbcOdbcDriver'; export const JDBC_ODBC_DRIVER_HELP_LINK = DecCst && DecCst.Hyperlink ? DecCst.Hyperlink.Database.OTHER_ODBC : ''; diff --git a/src/modules/pages/maintain/forms/form.server.ts b/src/modules/pages/maintain/forms/form.server.ts index b97bd94..a862e1f 100644 --- a/src/modules/pages/maintain/forms/form.server.ts +++ b/src/modules/pages/maintain/forms/form.server.ts @@ -1,6 +1,6 @@ import { Connection, ConnectionJDBC } from '../../../crud/crud.typings'; import { connectionType, errorCode } from '@constants/env'; -import { DATA_BASE_DRIVER_LINK, JDBC_ODBC_DRIVER, JDBC_ODBC_DRIVER_HELP_LINK } from '@constants/constant'; +import { DATA_BASE_DRIVER_LINK, JDBC_ODBC_DRIVER, JDBC_ODBC_DRIVER_HELP_LINK, DEFAULT_HELP_LINK } from '@constants/constant'; import { TestStatusXtype, EVENT_RELOAD, EVENT_CLOSE } from '../../../components/test_status/test_status'; import { getJdbcDatabaseType } from '../../../app.service'; import { ApiFactory } from '../../../crud/apiFactory'; @@ -31,8 +31,8 @@ export function testConnection(value: Connection): Promise { return; } const databaseType = (formValue.connectionData as ConnectionJDBC).database; - const databaseLink = BI.get(DATA_BASE_DRIVER_LINK.find(item => item.databaseType === databaseType), 'link'); - const link = Dec.system[DecCst.Hyperlink.DECISION_HYPERLINK_CONFIG][databaseLink] || BI.get(getJdbcDatabaseType(databaseType, driver), 'link'); + const databaseLink = BI.get(DATA_BASE_DRIVER_LINK.find(item => item.databaseType === databaseType), 'link', DEFAULT_HELP_LINK); + const link = BI.get(getJdbcDatabaseType(databaseType, driver), 'link') || Dec.system[DecCst.Hyperlink.DECISION_HYPERLINK_CONFIG][databaseLink]; testStatus.setFail(re.errorMsg, driver, link); } else { testStatus.setFail(re.errorMsg); From 5b8fdd9399cb90e28ed8cac5dfbc45956cab4b7e Mon Sep 17 00:00:00 2001 From: qiucong Date: Wed, 11 Nov 2020 20:03:56 +0800 Subject: [PATCH 5/5] =?UTF-8?q?DEC-15854=20fix:=20=E3=80=90=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=9E=E6=8E=A5=E3=80=91=E6=96=B0=E5=BB=BA=E5=85=B6?= =?UTF-8?q?=E4=BB=96JDBC=E7=B1=BB=E5=9E=8B=E6=95=B0=E6=8D=AE=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=EF=BC=8C=E9=BB=98=E8=AE=A4=E9=A9=B1=E5=8A=A8=E5=8F=AA?= =?UTF-8?q?=E6=9C=89=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/__test__/app.test.ts | 1 + src/modules/app.service.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/__test__/app.test.ts b/src/modules/__test__/app.test.ts index 2416310..e9711dc 100644 --- a/src/modules/__test__/app.test.ts +++ b/src/modules/__test__/app.test.ts @@ -19,6 +19,7 @@ test('DEC-11030 拼接url', () => { */ test('BI-56355 如果数据库类型和驱动都为空,则为其他jdbc', () => { expect(getJdbcDatabaseType('', '').databaseType).toEqual('otherJDBC'); + expect(getJdbcDatabaseType('otherJDBC', 'org.h2.Driver').databaseType).toEqual('otherJDBC'); expect(getJdbcDatabaseType('mysql', '').databaseType).toEqual('mysql'); expect(getJdbcDatabaseType('', 'com.mysql.jdbc.Driver').databaseType).toEqual('mysql'); }); diff --git a/src/modules/app.service.ts b/src/modules/app.service.ts index 0014d28..d8a0a2c 100644 --- a/src/modules/app.service.ts +++ b/src/modules/app.service.ts @@ -1,4 +1,4 @@ -import { DATA_BASE_TYPES, DATA_BASE_TYPES_OTHER, DESIGN_DRIVER_TYPE } from '@constants/constant'; +import { DATA_BASE_TYPES, DATA_BASE_TYPES_OTHER, DESIGN_DRIVER_TYPE, OTHER_JDBC } from '@constants/constant'; import { CONSTANT_PLUGIN_TYPES } from './app.constant'; import { DatabaseType } from './app.typings'; import { Connection } from './crud/crud.typings'; @@ -32,7 +32,8 @@ export function getJdbcDatabaseType(database: string, driver: string): DatabaseT } let databaseType = null; // 从全部数据库类型中获取jdbc类型的 - const jdbcDatabases = getAllDatabaseTypes().filter(v => v.type === 'jdbc'); + // 兼容之前的逻辑,otherJdbc要单独处理一下 + const jdbcDatabases = getAllDatabaseTypes().filter(v => v.type === 'jdbc' || v.type === OTHER_JDBC); // KERNEL-1655 兼容旧版 由于旧版设计器创建的数据连接database都为other,所以要根据driver来判断数据类型 if (database && database !== 'other' && jdbcDatabases.some(item => item.databaseType === database)) { databaseType = jdbcDatabases.find(item => item.databaseType === database);