通过ODBC连接AS400的DB2,碰到SQL8002N问题。
问题
朋友的朋友做AS400的项目,碰到SQL8002N问题,手机拍摄过来,错误信息如下:
错误很明显是SQL8002N的问题,是证书的问题!
那边证书问题,一直在弄开放平台的DB2(LUW),接触的客户端都不需要证书…
开始以为是AS400服务器端的DB2 证书问题.
经朋友去确认,去年10月份时候DB2是随AS400捆绑安装的,证书没问题。
哪里出问题?
ID和密码问题? 朋友测试通过,不同id和密码尝试去连接,报的错误是不一样的,排除…
换个思路,通过安装DB2 客户端做catalog尝试。
测试发现报的错误是SQL1598N了
问题就清晰了。
Per the following Information Center link:
It is possible to license the IBM Data Server Driver to connect to mainframe DB2 such as DB2 for z/OS, IBM DB2 for IBM i, and DB2 Server for VM and VSE servers by copying one of these files into the installation_path/license directory.
DB2 Connect Personal Edition: db2conpe.lic
DB2 Connect Application Server Edition: db2consv_as.lic
DB2 Connect Enterprise Edition: db2consv_ee.lic
DB2 Connect Unlimited Edition for System i: db2consv_is.lic
DB2 Connect Unlimited Edition for System z: db2consv_zs.lic
Even after copying the license file, a test connection may fail with the following error:
SQL1598N An attempt to connect to the database server failed because of a licensing problem. SQLSTATE=42968
至于怎么下载,参考如下文档:
How do I download my DB2 license from Passport Advantage
实在不行的话 换个新的client环境安装测试下。
参考资料
SQL8002N error due to %SystemDrive% environment variable missing