【发布时间】:2018-05-29 07:26:05
【问题描述】:
我开发了一个用于读取数据库表的小实用程序,我正在尝试访问 DB2 表。我正在使用 DB2 for z/OS,我的应用程序是一个独立的 JAR 文件,您必须使用 java -jar 在命令行中执行它。另外,我有从 DBA 收到的db2jcc_license_cu.jar 许可证。我已经尝试在我的 JAR 应用程序中打包此许可证,但我总是收到此错误:
[jcc][t4][10509][13454][4.21.29] Connection to the data server failed. The IBM Data Server for JDBC and SQLJ license was invalid
or was not activated for the DB2 for z/OS subsystem. If you are connecting directly to
the data server and using DB2 Connect Unlimited Edition for System z, perform the
activation step by running the activation program in the license activation kit.
If you are using any other edition of DB2 Connect, obtain the license file,
db2jcc_license_cisuz.jar, from the license activation kit, and follow the installation
directions to include the license file in the class path. ERRORCODE=-4230, SQLSTATE=42968
连接 url 是 jdbc:db2://<server>:<port>/<schema_name>:progressiveStreaming=2;,应该是 Type 4 连接。我正在使用通用 DB2 驱动程序。我不知道包含许可证 jar 是否足以使事情正常运行,或者我是否需要更多的东西,例如加载许可证或类似操作。
任何帮助将不胜感激。
【问题讨论】:
-
您的问题不完整,因为您没有说明您是要直接到 Z/os,还是间接(通过网关软件产品,例如 Db2-connect)。此选择确定所需的操作,如消息所示。如果您不知道是哪个,请询问您的 DBA。
-
我只使用 JDBC 驱动程序。我不知道我是不是直接去,我的 DBA 给了我许可证,并说我必须将它包含在我的应用程序中。
-
信息不够。 强制知道您是尝试直接连接到 z/OS 还是间接连接因为需要不同的许可活动。回去和你的 DBA 谈谈。