From 3e7509ebc20bcaed421b607f73ca8639c9eac86b Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Thu, 25 Jul 2024 16:26:16 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-114392=20FR-FBP=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E8=AE=BE=E8=AE=A1=E9=80=82=E9=85=8D=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E9=A2=84?= =?UTF-8?q?=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/preview/ConnectionInfoBeanHelper.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java index 72912cb6a4..571becabf4 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java @@ -5,6 +5,7 @@ import com.fr.data.auth.kerberos.KerberosAuthentication; import com.fr.data.auth.kerberos.KerberosUtils; import com.fr.data.impl.Connection; import com.fr.data.impl.JDBCDatabaseConnection; +import com.fr.data.impl.NameDatabaseConnection; import com.fr.data.pool.DBCPConnectionPoolAttr; import com.fr.data.security.ssh.BaseSsh; import com.fr.data.security.ssh.SshType; @@ -36,6 +37,10 @@ public class ConnectionInfoBeanHelper { * 创建数据连接Bean,可自定义是否携带密码 */ public static ConnectionInfoBean createConnectionInfoBean(String name, Connection connection, boolean withPassword) throws Exception { + if (connection instanceof NameDatabaseConnection) { + name = ((NameDatabaseConnection) connection).getName(); + connection = ((NameDatabaseConnection) connection).createDatabase(); + } if (JDBCConnectionProcessor.KEY.acceptConnections().contains(connection.getClass())) { ConnectionInfoBean bean = new ConnectionInfoBean(); bean.setConnectionData(objectMapper.writeValueAsString(convertToJDBCConnectionBean(connection, withPassword)));