0

I am trying to insert/update NCLOB data on oracle using mybatis. But having problem with this.

Data type of column is NCLOB and below is the code i used on sqldeveloper to test it.

UPDATE CONTENT_TABLE SET HTML_DATA = N'通过信息通信系统的整合' WHERE SEQ = 1;

I tried this on sqldeveloper to test it and it works fine.(I put 'N' in front of inserting string for NCLOB. But when i try it by mybatis it does not work... here is the code i tried on mybatis.

UPDATE CONTENT_TABLE SET HTML_DATA = N#{htmlData} WHERE SEQ = 1

That didn't work. Is there any way to use that 'N' to put on NCLOB data in mybatis other ways? (by the way, the reason i used NCLOB data type is to put chinese data on DB.. otherwise when data type was just CLOB, the chinese data that i insert was broken..

Sudipta Mondal
  • 2,550
  • 1
  • 19
  • 20
  • Have you tried setting the characterEncoding as described in https://stackoverflow.com/questions/14079525/how-to-update-mysql-fields-into-chinese-using-mybatis ? (that question is for MySQL, but this might work for Oracle, as well) – Frank Schmitt Jul 25 '17 at 07:48
  • @FrankSchmitt i tried it but it gives CannotGetJdbcConnectionException... i guess i need to know the way insert by using that 'N' before the data...by the way, thanks :) – Jung Young-min Jul 25 '17 at 07:54
  • Not sure, about mybatis, but maybe there is something in this answer - https://stackoverflow.com/questions/13698405/how-to-insert-unicode-to-oracle-nvarchar-using-mybatis-with-spring-integration – Sudipta Mondal Jul 25 '17 at 08:10
  • @SudiptaMondal ok, i will try it and reply the answer thx – Jung Young-min Jul 25 '17 at 08:17
  • @SudiptaMondal i dont understand where to place the code provied on link... – Jung Young-min Jul 25 '17 at 09:00
  • Does this answer your question? [mybatis text literal n without Tomcat parameters](https://stackoverflow.com/questions/75878235/mybatis-text-literal-n-without-tomcat-parameters) – zhangc Aug 21 '23 at 07:30

0 Answers0