Topic
5 replies Latest Post - ‏2013-06-04T17:00:54Z by RajuRathi
allen.montejo
allen.montejo
4 Posts
ACCEPTED ANSWER

Pinned topic Caught java.io.CharConversionException. See attached Throwable for details

‏2010-11-05T15:13:42Z |
Hello Everyone,

We are having problem w/ retrieving data column that has special character from the db2 database. when we try to use the recordset.getString(columname) method we catch the exception below. Is there any workaround how to retrieve the data w/ out exception?

Error catch:

R com.ibm.db2.jcc.b.SqlException: jcct4106512306http://3.50.152 Caught java.io.CharConversionException. See attached Throwable for details. ERRORCODE=-4220, SQLSTATE=null
  • think! and do something different, something has never been done and seen before..
Updated on 2010-12-14T13:04:40Z at 2010-12-14T13:04:40Z by allen.montejo
  • allen.montejo
    allen.montejo
    4 Posts
    ACCEPTED ANSWER

    Re: Caught java.io.CharConversionException. See attached Throwable for details

    ‏2010-11-05T15:32:52Z  in response to allen.montejo
    I tried to use getBytes() method and catch different error:

    Invalid data conversion: Wrong result column type for requested conversion. ERRORCODE=-4461, SQLSTATE=42815

    Any idea how to resolve this?
    • SystemAdmin
      SystemAdmin
      1632 Posts
      ACCEPTED ANSWER

      Re: Caught java.io.CharConversionException. See attached Throwable for details

      ‏2010-11-05T18:49:30Z  in response to allen.montejo
      Can you give us the following information?
      • what is your db server? z/OS or LUW
      • what function was doing the retrieving? executing a SQL stmt; returning a result set; browsing/viewing table contents?
      • what is the specific special register you were using?
      • SystemAdmin
        SystemAdmin
        1632 Posts
        ACCEPTED ANSWER

        Re: Caught java.io.CharConversionException. See attached Throwable for details

        ‏2010-11-05T18:50:11Z  in response to SystemAdmin
        Correction...what is the datatype of the column with the special character.
        Thanks.
        • allen.montejo
          allen.montejo
          4 Posts
          ACCEPTED ANSWER

          Re: Caught java.io.CharConversionException. See attached Throwable for details

          ‏2010-12-14T13:04:40Z  in response to SystemAdmin
          It was a type of VARCHAR(256).
      • RajuRathi
        RajuRathi
        1 Post
        ACCEPTED ANSWER

        Re: Caught java.io.CharConversionException. See attached Throwable for details

        ‏2013-06-04T17:00:54Z  in response to SystemAdmin

        Hi ,I'm also facing similar issue . we are using GRAPHICS type and whenever we tried to communicate to Store Procedure contain this type as parameter , I'm getting below error . I'm using latest version of DB2 drive

        com.ibm.db2.jcc.am.SqlException: [jcc][t4][1065][12306][3.65.77] Caught java.io.CharConversionException.  See attached Throwable for details. ERRORCODE=-4220, SQLSTATE=null
            at com.ibm.db2.jcc.am.cd.a(cd.java:682)
            at com.ibm.db2.jcc.am.cd.a(cd.java:60)
            at com.ibm.db2.jcc.am.cd.a(cd.java:112)
            at com.ibm.db2.jcc.am.gc.a(gc.java:2825)
            at com.ibm.db2.jcc.am.gc.a(gc.java:582)
            at com.ibm.db2.jcc.am.gc.q(gc.java:560)
            at com.ibm.db2.jcc.am.gc.N(gc.java:1557)
            at com.ibm.db2.jcc.am.gc.a(gc.java:1541)
            at com.ibm.db2.jcc.am.CallableStatement.D(CallableStatement.java:941)
            at com.ibm.db2.jcc.am.CallableStatement.getString(CallableStatement.java:920)
            at com.cst.test.daoLayer.DoubleByteTest.callDB2ProcOUTParameter(DoubleByteTest.java:38)Second SP IDOEINS Call

            at com.cst.test.daoLayer.DoubleByteTest.main(DoubleByteTest.java:103)
        Caused by: java.nio.charset.MalformedInputException: Input length = 5
            at com.ibm.db2.jcc.am.r.a(r.java:19)
            at com.ibm.db2.jcc.am.gc.a(gc.java:2821)
            ... 8 more
        Caused by: sun.io.MalformedInputException
            at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:278)
            at com.ibm.db2.jcc.am.r.a(r.java:16)
            ... 9 more