連線DB2有時會遇上java.io.CharConversionException

之前做的案子遇啟動時或連接時,有時候會遇上的問題,與資料編碼轉相關,留個解法。

問題:
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

解法:
在java_opts後面加上參數(-Ddb2.jcc.charsetDecoderEncoder=3)
註: 在tomcat或JBoss啟動放上參數即可

參考:

more info:Sqoop error for java.io.charconversionException which is non UTF-8 charactor