使用 testconn40.exe 测试 ibm 数据服务器连接

Testing ibm data server connection with testconn40.exe

您好,我在尝试测试与 Informix 服务器的连接时遇到错误。我执行的步骤:

1.Install IBM 数据服务器客户端

2.Install IBM 数据服务器运行时客户端

3.after 我使用 cmd 导航到数据服务器驱动程序 Package\bin\netf40 并执行这三行代码

gacutil /i IBM.Data.DB2.dll
gacutil /i IBM.Data.DB2.Entity.dll
gacutil /i IBM.Data.Informix.dll

4.Insalled Visual Studio 的 IBM 数据库插件(我有 2015 版)

我想做的是使用引用 IBM.Data.DB2 或 IBM.Data.Informix[=31 替换连接到 informix 服务器的旧 odbc 方式=]

但在做更多事情之前,在测试我与 testconn40.exe 的连接时,我在第 3 步遇到通信错误。这是我在 cmd

中运行的代码
testconn40.exe -ids database=ibis2;server=192.168.1.2:9088;userid=informix;password=informix

这给了我这行代码

using Common Informix .NET provider
Step 1: Printing version info
        .NET Framework version: 4.0.30319.42000
        Factory for invariant name IBM.Data.Informix verified
        IBM.Data.Informix from DbFactory is the Common Informix .NET provider
        Common Informix .NET provider version: 9.7.4.4
        Common Informix .NET provider file version: 11.1.2020.4
        Capability bits: ALLDEFINED
        Build: s1706091900
        Warning, failed load of DbFactory for:IBM.Data.Informix.11.1.0
        Warning, failed load of DbFactory for:IBM.Data.Informix.11.1.1011
        IBM Database Add-ins assembly version: 9.1.0.0
        IBM Database Add-ins file version: 11.1.2020.5
        Elapsed: 0,248704
Step 2: DB2DSDRIVER_CFG_PATH env var: unset
        Validating db2dsdriver.cfg against db2dsdriver.xsd schema file
        File searched at C:\ProgramData\IBM\DB2\DB2COPY1\cfg\db2dsdriver.cfg  missing. Nothing to validate
        Elapsed: 0,0070187
Step 3: Connecting using Common Informix provider "database=ibis2;server=192.168.1.2:9088;userid=informix;password=informix"

Unable to open socket to server:
ERROR [08001] [IBM] SQL30081N  A communication error has been detected. Communication protocol being used: "TCP/IP".  Communication API being used: "SOCKETS".  Location where the error was detected: "192.168.1.2".  Communication function detecting the error: "recv".  Protocol specific error code(s): "*", "*", "0".  SQLSTATE=08001
Some things to consider:
- is the port number correctly specified
  50000 is the default for LUW servers
    svcename dbm cfg parm for LUW servers
  446 is the only port for iSeries servers, default for zSeries
- for a LUW server, is the TCPIP listener started
  db2set DB2COMM=TCPIP, db2stop / db2start
- for an Informix server, ensure DRDA listener is started
  and you are using DRDA port vs the SQLI port
Test failed.

您的 IDS 服务器是否启用了 DRDA 连接? Native Informix CSDK 使用 SQLI 协议进行通信,但 IBM Data Server Driver 使用 DRDA。 您在 testconn40 输出中看到的错误通常意味着您正在尝试连接到 SQLI 侦听器,而不是 DRDA 侦听器。

基本上,您需要在您的 onconfig 文件中定义一个别名 (DBSERVERALIASES),指向 sqlhosts 文件中的一个条目,使用 "drsoctcp" 作为协议。

如果您进行了默认安装,它应该已经存在,所以只需使用 port/service 而不是 olsoctcp。