DB2 在尝试访问日期字段时给出 nio.unsupportedcharsetexception CP836

DB2 giving nio.unsupportedcharsetexception CP836 while trying to access date fields

DB2 在尝试访问 date/timestamp 字段时给出 nio.unsupportedcharsetexception CP836。我正在使用 db2jcc4.jar 作为 DB2 的驱动程序。 我收到以下异常 java.nio.charset.UnsupportedCharsetException: Cp836

我正在尝试使用 DBeaver 和 Squirrel 都只提供这么多堆栈跟踪。

并且正在使用 z/os 平台 java版本:1.8 能够 select 列值,如果该列不是 date/timestamp 类型 连接字符串:jdbc:db2://********:451/***B

这是一个配置问题。

检查您使用的 DBeaver(Oracle/Sun、IBM 或其他)的 jre。

https://www.ibm.com/support/pages/errorcode-4220-received-when-using-ccsid-13124cp836-connect-as400-db-using-db2-jcc-type-4-driver

特别是这个建议:

IBM has a charset support for every CCSID IBM machines deal with.

Oracle/Sun JDK/JRE uses charsets.jar to provide character mapping between UTF-8 and various code pages.

Oracle/Sun jre has separate international installations and that localized install would not have all conversion classes. So you will need to obtain a full JDK installation.

It is best to use latest IBM JDK. It contains both rt.jar and charsets.jar containing the class file ByteToCharCp836.class.

Download here:

https://www.ibm.com/developerworks/java/jdk/index.html