From ec630185df63bd1fc551211cb7ed788badadf649 Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Fri, 10 Feb 2023 10:24:35 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-89171=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=8D=E6=94=AF=E6=8C=81=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E7=B1=BB=E5=9E=8B=E6=9C=AA=E5=8F=97=E5=88=B0?= =?UTF-8?q?=E9=99=90=E5=88=B6=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=91=E6=9C=AA=E8=80=83=E8=99=91=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E4=B8=8B=EF=BC=8C=E8=8E=B7=E5=8F=96=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E7=9A=84lic=E4=BF=A1=E6=81=AF=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?rpc=E6=8E=A5=E5=8F=A3=EF=BC=8C=E8=8E=B7=E5=8F=96=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8lic=E6=98=AF=E5=90=A6=E9=99=90=E5=88=B6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/connect/ConnectionListPane.java | 3 ++- .../datapane/connect/ConnectionManagerPane.java | 13 +++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) 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;