Create CLOB from long string using JDBC

后端 未结 2 583
小鲜肉
小鲜肉 2021-01-12 23:12

I have the following query:

select id from table1 where some_func(?) = 1;

where some_func is a function which allows its argum

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-12 23:34

    From my experience setCharacterStream() is much more reliable than setClob()

    String s = (String) obj;
    StringReader stringReader = new StringReader(s);
    stmt.setCharacterStream(i + 1, stringReader , s.length());
    

    and it works without the need to create CLOB objects

提交回复
热议问题