Skip to Content
avatar image
Former Member

SAP DBTech JDBC: [7]: feature not supported: invalid CESU-8 encoding for Unicode string

Hi,

I am using plain JDBC to insert records in the table. I see this issue during the row insertion very frequently..(not consistently though)

Below is the stack trace:

Caused by: com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [7]: feature not supported: invalid CESU-8 encoding for Unicode string at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.createException(SQLExceptionSapDB.java:357) at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.generateDatabaseException(SQLExceptionSapDB.java:197) at com.sap.db.jdbc.packet.ReplyPacket.buildExceptionChain(ReplyPacket.java:110) at com.sap.db.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:934) at com.sap.db.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:717) at com.sap.db.jdbc.CallableStatementSapDB.execute(CallableStatementSapDB.java:523) at com.sap.db.jdbc.CallableStatementSapDB.execute(CallableStatementSapDB.java:361) at com.sap.db.jdbc.CallableStatementSapDB.executeUpdate(CallableStatementSapDB.java:903) at com.sap.db.jdbc.trace.PreparedStatement.executeUpdate(PreparedStatement.java:240)

Can someone please tell me what this error means ? And how to resolve. ?

Thank you very much in advance'

Digneshn

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jun 18, 2017 at 02:18 AM

    As common with questions why a certain piece of code doesn't work as expected, it's hard to tell, what's wrong without actually seeing your code.

    From the error message, my best guess is that you try and feed a byte-stream of sorts into an NVARCHAR field. SAP HANA supports UTF-8/CESU-8 encoding which means that only certain combinations of bytes are actually valid. Therefore, the next step in analysing this issue should probably be to review the bytes that you try to store in SAP HANA.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 18, 2017 at 07:57 AM

    Thank you very much for your reply.

    I am using string,getBytes() in my code.. Possibly I will try passing "UTF-8" charset to the getBytes method to see if it resolves the issue.

    Thank you once again.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 18, 2017 at 07:58 AM

    Thank you very much for your reply.

    I am using String.getBytes() in code. Possibly i try to pass "UTF-8" as charset to getBytes method to see if it resolves the issue.

    Thank you once again. :)

    Add comment
    10|10000 characters needed characters exceeded