简体   繁体   English

无法使用 python ibm_db 连接 zOS DB2

[英]Not able to connect zOS DB2 with python ibm_db

I am not able to connect to remote zOS DB2 with python ibm db package.我无法使用 python ibm db包连接到远程zOS DB2 while connecting I am getting below error:连接时出现以下错误:

: [IBM][CLI Driver] SQL30081N  A communication error has been detected.
Communication protocol being used: "TCP/IP".
Communication API being use d: "SOCKETS".
Location where the be error was detected: "HOSTNAME".
Communication function detecting the error: "recv".
Protocol specific error code(s): "104", "*", "0".  SQLSTATE=08001`

How can I solve this error?.我该如何解决这个错误?。

Just to add firewall is open.只是添加防火墙是开放的。 Telnet and openssl is working fine. Telnet 和 openssl 工作正常。

I did not get how did you connect.没看懂你是怎么连接的。 Please, try the following to help us to understand from where are you coming from:请尝试以下操作来帮助我们了解您来自哪里:

import ibm_db
ibm_db.connect("DATABASE=;HOSTNAME=;PORT=;PROTOCOL=TCPIP;UID=;PWD=;", "", "")

I am able to connect to the remote zOS DB2 using below connection string:我能够使用以下连接字符串连接到远程 zOS DB2:

import ibm_db导入 ibm_db

ibm_db.connect("Security=SSL;database=dbname;hostname=hostip;port=port;Protocol=TCPIP;SSLClientKeystoredb=pathtothekeystoredbfile(file extension.kdb);SSLClientKeystash=pathtothekeystashfile(file extension.sth);uid=userid;pwd=password", "", "") ibm_db.connect("Security=SSL;database=dbname;hostname=hostip;port=port;Protocol=TCPIP;SSLClientKeystoredb=pathtothekeystoredbfile(file extension.kdb);SSLClientKeystash=pathtothekeystashfile(file extension.sth);uid=userid;pwd = 密码", "", "")

Also, I had to put the licence file "db2consv_zs.lic" to the LICENSE folder of ibm_db.另外,我必须将许可证文件“db2consv_zs.lic”放到 ibm_db 的 LICENSE 文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM