cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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. 🙂

Former Member
0 Kudos

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.

lbreddemann
Active Contributor
0 Kudos

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.