Browse Source

REPORT-114392 FR-FBP版本本地设计适配 修复数据连接预览

mss/2.0
Destiny.Lin 4 months ago
parent
commit
3e7509ebc2
  1. 5
      designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java

5
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.auth.kerberos.KerberosUtils;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.NameDatabaseConnection;
import com.fr.data.pool.DBCPConnectionPoolAttr; import com.fr.data.pool.DBCPConnectionPoolAttr;
import com.fr.data.security.ssh.BaseSsh; import com.fr.data.security.ssh.BaseSsh;
import com.fr.data.security.ssh.SshType; import com.fr.data.security.ssh.SshType;
@ -36,6 +37,10 @@ public class ConnectionInfoBeanHelper {
* 创建数据连接Bean可自定义是否携带密码 * 创建数据连接Bean可自定义是否携带密码
*/ */
public static ConnectionInfoBean createConnectionInfoBean(String name, Connection connection, boolean withPassword) throws Exception { 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())) { if (JDBCConnectionProcessor.KEY.acceptConnections().contains(connection.getClass())) {
ConnectionInfoBean bean = new ConnectionInfoBean(); ConnectionInfoBean bean = new ConnectionInfoBean();
bean.setConnectionData(objectMapper.writeValueAsString(convertToJDBCConnectionBean(connection, withPassword))); bean.setConnectionData(objectMapper.writeValueAsString(convertToJDBCConnectionBean(connection, withPassword)));

Loading…
Cancel
Save