IBM Support

java.io.CharConversionException occurs when accessing DBCS data from a JDBC application running under JRE 1.8+

Troubleshooting


Problem

An application using the IBM Data Server Driver for JDBC and SQLJ accesses a database that uses double byte character set encoding for character data (such as CCSID 1399 - Japanese). When running under JRE 1.8 or above, the application receives an SQL Exception with the message "Caught java.io.CharConversionException" and ERRORCODE=-4220 on querying character data..

Symptom

An exception is thrown similar to this:


com.ibm.db2.jcc.am.SqlException: [jcc][t4][1065][12306][XXX.XXX.XXX] Caught java.io.CharConversionException. See attached Throwable for details. ERRORCODE=-4220, SQLSTATE=null
[...]
Caused by: java.nio.charset.MalformedInputException: Input length = XXX
[...]

The same application works without any exceptions under JRE 1.7 or lower.

[{"Product":{"code":"SSEPDU","label":"Db2 Connect"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.7;10.1;10.5","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
30 April 2025

UID

swg21982529