How to update Oracle Clob by using JDBC

后端 未结 1 1879
轮回少年
轮回少年 2020-12-22 01:57

Normal way looks like this:

    pStmt = conn.prepareStatement(\"SELECT DETAILS FROM PROGRAM_HISTORY WHERE id = 12\");
    rset = pStmt.executeQuery();
    Cl         


        
相关标签:
1条回答
  • 2020-12-22 02:16

    Not sure why you call that the "normal" way, but the following works for me.

    It doesn't require any retrieval of the data before updating it.

    String value = "So long and thanks for all the fish";
    StringReader reader = new StringReader(value);
    pStmt = conn.prepareStatement("UPDATE PROGRAM_HISTORY SET DETAILS = ? WHERE ID = 12");
    pStmt.setCharacterStream(1, reader, value.length());
    pStmt.executeUpdate();
    
    0 讨论(0)
提交回复
热议问题