Browse Source

DEC-14009 1.8以上版本JDK支持ODBC连接

research/10.0
qcc 4 years ago
parent
commit
60eb6a5e9a
  1. 3
      src/modules/constants/constant.ts
  2. 8
      src/modules/pages/maintain/forms/form.server.ts

3
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',

8
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<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]);

Loading…
Cancel
Save