How to use setClob method in jdbc?

后端 未结 2 454
一整个雨季
一整个雨季 2021-01-26 11:49

I need to insert a large string as clob into a table. I am using setClob method of PreparedStatement. But the values are not getting inserted into the database table. Can anyone

2条回答
  •  独厮守ぢ
    2021-01-26 12:07

    What database are you inserting the value to? For example for Oracle back-end, preparedStatement methods have 4k limitation on CLOB.

    You could use:

    Clob clob = ...
    String chuck = clob.getSubString(1,10);
    clob.setString(1,chuck);
    

    To verify that the size is not the issue here.

提交回复
热议问题