Create CLOB from long string using JDBC

后端 未结 2 610
小鲜肉
小鲜肉 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:21

    The CLOB could be created in a simple manner:

    if(obj instanceof String && ((String) obj).length() >= 4000) {
        Clob clob = connection.createClob();
        clob.setString(1, (String) obj);
        stmt.setClob(i+1, clob);
    }

    Then these clobs should be freed of course.

提交回复
热议问题