Java 保存 oracle CLOB 類型字段並插入數據庫

要將clob類型字段插入Oracle,需要通過字符流進行處理,處理如下:

...
String fieldValue = "testClob,testClob,testClob,testClob,testClob";
 // 轉成流形式 
Reader reader = new StringReader(fieldValue);
preparedStatement.setCharacterStream(1, reader, fieldValue.length());
...

參考:
Java 存儲和讀取 oracle CLOB 類型字段的實用方法

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章