gpt4 book ai didi

ssl - 使用 Pyspark 通过 SSL 连接到 DB2

转载 作者:太空宇宙 更新时间:2023-11-03 14:28:47 26 4
gpt4 key购买 nike

我正尝试在 Linux 上使用 Pyspark 通过 SSL 连接到 DB2。我尝试了以下

user = "xxxx"
password = "xxxxx"
jdbcURL = "jdbc:db2://nn.nn.nnn.nnn:nnnn/<database>"
prop = {"user": user, "password": password, "driver":
"com.ibm.db2.jcc.DB2Driver", "sslConnection": "true"}
table = "<schema>.<table name>"
df = spark.read.jdbc(url=jdbcURL, table=table, properties=prop)

我也试过

user = "xxxx"
password = "xxxxx"
jdbcURL = "jdbc:db2://nn.nn.nnn.nnn:nnnn/<database>"
prop = {"user": user, "password": password, "driver":
"com.ibm.db2.jcc.DB2Driver", "sslConnection": "true"
"Security": "SSL", "SSLServerCertificate": "<path to arm file>"}}
table = "<schema>.<table name>"
df = spark.read.jdbc(url=jdbcURL, table=table, properties=prop)

我在这两种情况下都得到了同样的错误或套接字输出流。

Error location: Reply.fill() - socketInputStream.read (-1). Message: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target. ERRORCODE=-4499, SQLSTATE=08001

我不确定指定 .arm 路径的语法。卡住。请帮忙

象头神

附言我可以使用

连接 python 和 ibm_db 模块
import ibm_db
conn = ibm_db.connect("DATABASE=<database>
;HOSTNAME=nn.nn.nnn.nnn:nnnn;SECURITY=SSL;SSLServerCertificate=<path to arm
file> ;UID=<user>;PWD=<password>","","")

这有效。

最佳答案

这已通过重新安装 Java 证书解决。

关于ssl - 使用 Pyspark 通过 SSL 连接到 DB2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54549606/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com