Browse Source

REPORT-134200 【fr-fbp回归】建立hsql数据驱动的数据连接失败

fbp/release
Destiny.Lin 2 months ago
parent
commit
86c339f163
  1. 10
      designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java

10
designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java

@ -157,7 +157,7 @@ public class ConnectionInfoBeanHelper {
.user(jdbcConnection.getUser()) .user(jdbcConnection.getUser())
.driver(jdbcConnection.getDriver()) .driver(jdbcConnection.getDriver())
// 关键中的关键,由设计器发出的请求如果要携带密码,不能传明文,必须必须必须传加密后的密码 // 关键中的关键,由设计器发出的请求如果要携带密码,不能传明文,必须必须必须传加密后的密码
.password(withPassword ? encrypt(jdbcConnection.getPassword()) : DecisionServiceConstants.DEFAULT_PASSWORD) .password(withPassword ? DataEncryptionHelper.encrypt(jdbcConnection.getPassword()) : DecisionServiceConstants.DEFAULT_PASSWORD)
.schema(jdbcConnection.getSchema()) .schema(jdbcConnection.getSchema())
.url(jdbcConnection.getURL()) .url(jdbcConnection.getURL())
.creator(jdbcConnection.getCreator()) .creator(jdbcConnection.getCreator())
@ -188,14 +188,6 @@ public class ConnectionInfoBeanHelper {
.verifyCa(jdbcConnection.getSsl().getSslType() == SslType.NORMAL && ((NormalSsl) jdbcConnection.getSsl()).isVerifyCa()); .verifyCa(jdbcConnection.getSsl().getSslType() == SslType.NORMAL && ((NormalSsl) jdbcConnection.getSsl()).isVerifyCa());
} }
private static String encrypt(String password) {
// 如果是空密码或者默认密码,就返回默认的星号回去
if (StringUtils.isEmpty(password) || StringUtils.equals(password, DecisionServiceConstants.DEFAULT_PASSWORD)) {
return DecisionServiceConstants.DEFAULT_PASSWORD;
}
return TransmissionEncryptionManager.getInstance().getEncryption(WorkplaceConstants.getEncryptionMode()).encrypt(password, WorkplaceConstants.getEncryptionKey());
}
private static Connection createJDBCConnection(ConnectionInfoBean connectionInfoBean) throws Exception { private static Connection createJDBCConnection(ConnectionInfoBean connectionInfoBean) throws Exception {
String name = connectionInfoBean.getConnectionName(); String name = connectionInfoBean.getConnectionName();

Loading…
Cancel
Save