search cancel

DB2 masking ERRORCODE=-4220, SQLSTATE=null

book

Article ID: 252869

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

While masking for DB2 IIAS database , we are facing error as:

 Error executing select statement for update, Error Executing Batch: com.ibm.db2.jcc.am.SqlException: [jcc][t4][1065][12306][4.31.10] Caught java.io.CharConversionException. See attached Throwable for details. ERRORCODE=-4220, SQLSTATE=null, CURSOR COUNT:1366

Following this, we raised support request with IBM support team and they said this is due to the invalid data in the database and that there are two options either correct the data in the database or alternatively
you can set the JCC configuration property db2.jcc.charsetDecoderEncoder=3 so that instead of throwing an exception the JCC driver returns the Unicode REPLACEMENT CHARACTER (U+FFFD) in place of a sequence of bytes that is not a valid UTF-8 string.

When we enquired on this further , we got to know that for the JCC configuration property db2.jcc.charsetDecoderEncoder=3, this need to be set on the application used.

So we need to understand where we set this in our TDM application properties or on TDM application server so that the JCC driver returns the Unicode REPLACEMENT CHARACTER (U+FFFD) in place of a sequence of bytes that is not a valid UTF-8 string.

Some important links for information: 

  • https://www.ibm.com/support/pages/sqlexception-message-caught-javaiocharconversionexception-and-errorcode-4220
  • https://knowledge.broadcom.com/external/article?articleId=228108
  • https://www.ibm.com/support/pages/java-exception-occurs-when-browsing-table-data-including-syscatcolumns-or-sysibmsyscolumns

Environment

Release : 4.10

Cause

Product limitation.

Resolution

Fixed patch build is available at https://ftp.broadcom.com/user/downloads/pub/TDM/TDMPortal/TDMWeb-4.10.115.0.zip.

Set the new masking option DB2REPLACEINVALIDCHARS to Y.

However this option is "valid" only in Portal, when masking with FDM directly you still need to modify the batch script and add the additional property -Ddb2.jcc.charsetDecoderEncoder=3.