diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java index 8eb13afca0..0e0a655a08 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java @@ -22,7 +22,6 @@ import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionOperator; import com.fr.general.NameObject; import com.fr.log.FineLoggerFactory; -import com.fr.regist.FRCoreContext; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; @@ -116,6 +115,8 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh /** * 创建菜单项 + *
+ * 方法中获取limitDatabaseType使用了远程rpc调用,可能会比较耗时 * * @return 菜单项 */ diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java index 0c1d88022e..eb8171d353 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java @@ -1,14 +1,16 @@ package com.fr.design.data.datapane.connect; import com.fr.data.impl.Connection; +import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.design.gui.frpane.LoadingBasicPane; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.file.ConnectionConfig; import com.fr.general.NameObject; -import com.fr.license.database.DatabaseTypeValidateUtil; import com.fr.license.exception.DataBaseNotSupportedException; import com.fr.stable.Nameable; +import com.fr.workspace.WorkContext; +import com.fr.workspace.server.database.DataBaseTypeOperator; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -75,7 +77,14 @@ public class ConnectionManagerPane extends LoadingBasicPane implements Connectio Nameable wrapper = selectedValue.wrapper; try { Connection connection = (Connection) ((NameObject) wrapper).getObject(); - DatabaseTypeValidateUtil.validateDatabaseType(connection.getDriver(), connection.feature()); + // 仅校验jdbc连接,其他插件数据连接不进行校验 + if (connection instanceof JDBCDatabaseConnection) { + DataBaseNotSupportedException exception = WorkContext.getCurrent().get(DataBaseTypeOperator.class).validateDatabaseType(connection.getDriver(), connection.feature()); + if (exception != null) { + throw exception; + } + } + } catch (DataBaseNotSupportedException e) { // 仅抛出数据库类型不支持异常 throw e;