diff --git a/src/modules/constants/constant.ts b/src/modules/constants/constant.ts index 2a5c9d2..1caf7b9 100644 --- a/src/modules/constants/constant.ts +++ b/src/modules/constants/constant.ts @@ -9,6 +9,9 @@ export const PAGE_INDEX = { export const OTHER_JDBC = 'otherJDBC'; +export const JDBC_ODBC_DRIVER = 'sun.jdbc.odbc.JdbcOdbcDriver'; +export const JDBC_ODBC_DRIVER_HELP_LINK = DecCst.Hyperlink.Database.OTHER_ODBC; + export const DATEBASE_FILTER_TYPE = { COMMONLY: 'commonly', ALL: 'all', diff --git a/src/modules/pages/maintain/forms/form.server.ts b/src/modules/pages/maintain/forms/form.server.ts index 8ec4473..e144378 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 } from '@constants/constant'; +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 { ApiFactory } from '../../../crud/apiFactory'; const api = new ApiFactory().create(); @@ -23,6 +23,12 @@ export function testConnection(value: Connection): Promise { if (api.isDriverError(re.errorCode)) { if (formValue.connectionType === connectionType.JDBC) { const driver = (formValue.connectionData as ConnectionJDBC).driver; + // DEC-14009 1.8以上版本JDK支持ODBC连接 + if (driver === JDBC_ODBC_DRIVER) { + testStatus.setFail(re.errorMsg, driver, Dec.system[DecCst.Hyperlink.DECISION_HYPERLINK_CONFIG][JDBC_ODBC_DRIVER_HELP_LINK]); + + return; + } 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]);