我想使用SSL证书从Spark(Scala)代码连接到DB2。请提供连接字符串的格式以及建立连接所需的属性。
krugob8w1#
jdbc:db2://host:port/database:sslConnection=true;sslTrustStoreLocation=/full/path/to/truststore/file;sslTrustStorePassword=truststorePassword;或jdbc:db2://host:port/database:sslConnection=true;sslTrustStoreLocation=/full/path/to/truststore/file;sslTrustStorePassword=truststorePassword;个不要删除URL的结束字符;。请注意,Db2对SSL和非SSL连接使用不同的端口,并且必须在服务器端正确配置SSL支持。有用的链接:Configuring connections under the IBM Data Server Driver for JDBC and SQLJ to use TLSCommon IBM Data Server Driver for JDBC and SQLJ properties for all supported database products
jdbc:db2://host:port/database:sslConnection=true;sslTrustStoreLocation=/full/path/to/truststore/file;sslTrustStorePassword=truststorePassword;
;
1条答案
按热度按时间krugob8w1#
jdbc:db2://host:port/database:sslConnection=true;sslTrustStoreLocation=/full/path/to/truststore/file;sslTrustStorePassword=truststorePassword;
或
jdbc:db2://host:port/database:sslConnection=true;sslTrustStoreLocation=/full/path/to/truststore/file;sslTrustStorePassword=truststorePassword;
个不要删除URL的结束字符
;
。请注意,Db2对SSL和非SSL连接使用不同的端口,并且必须在服务器端正确配置SSL支持。
有用的链接:
Configuring connections under the IBM Data Server Driver for JDBC and SQLJ to use TLS
Common IBM Data Server Driver for JDBC and SQLJ properties for all supported database products