DAL01013:无法连接到服务器

DAL01013: Cannot connect to server

我正在尝试连接到 DB2 数据库,但出现错误:

DAL01013. Cannot create connection to server 'Unknown server' due to the following: [jcc][t4][2034][11148][3.69.24] Execution failed due to a distribution protocol error that caused deallocation of the conversation.
A DRDA Data Stream Syntax Error was detected.  Reason: 0x3. ERRORCODE=-4499, SQLSTATE=58009

假设这是我系统的问题。我无法通过 DataStudio 或 QMF 进行连接。来自其他系统的其他用户可以。我使用相同的 jdbc 驱动程序。我的系统是Windows7。 我的系统还需要调整什么吗?

需要先创建个人仓库:

https://developer.ibm.com/answers/questions/470013/error-when-trying-to-connect-to-db2-vis-qmf/

当您连接到 SSL 端口时,通常您会从 IBM JDBC 驱动程序的错误 -4499 中得到原因 0x3,但您没有指定 sslConnection=true 在您的 JDBC 连接字符串上。如果您的数据库名称不正确(即服务器上不存在),或者您的 JDBC 驱动程序太旧 (DB2 JDBC Driver Versions and Downloads Download Fix Packs by version for IBM Data Server Client Packages)

,您也可能会收到错误消息

如果连接到 Db2 on Cloud、Db2 Warehouse 或 Db2 Warehouse on Cloud,您只需要 sslConnection=true,因为这些产品中使用的 CA 证书是 Db2 驱动程序包的一部分(对于最近的驱动程序)无论如何)

如果在本地连接到 Db2,您可以通过 JDBC 属性 sslCertLocationsslTrustStoreLocationsslTrustStorePassword

指定您的证书位置

Common IBM Data Server Driver for JDBC and SQLJ properties for all supported database products

sslCertLocation Specifies that an application can configure the location of a trusted certificate file. For applications that have the database server certificate, sslCertLocation is the only property that is needed to be configured to instruct IBM Data Server Driver for JDBC and SQLJ to trust the certificate for SSL connections. This property removes the need to import the certificate into a Java truststore database and related driver configurations.

Error codes issued by the IBM Data Server Driver for JDBC and SQLJ

error codes in the ranges -4200 to -4299, and -4450 to -4499 are reserved for the IBM® Data Server Driver for JDBC and SQLJ.