|
|
|
@ -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<string[]> {
|
|
|
|
|
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]); |
|
|
|
|