|
|
@ -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))); |
|
|
|