Find a bunch of references online, either vague or not. I tinker with a bunch can be normal storage. Take a look at the end:
Insert INTO Cp_v_info "+" (ID, "+" project_id, "+..."V_info," +..."VERSION" VALUES (?,?,?,?,?,?,?,?,?,?, "+"?,?, Empty_clob (),?,?,?,?,?,?,?, "+"?,?,?,? ,?,?,?,?,?,?," + "?)"; This. Cdcdao.executesql (SQL, V7info.getid (), V7info.getprojectid (),......);//Insert the data first, and insert it in the field with Empty_clob (). //Then for updateString update_sql = "Select V_info from Cp_v_info where id= '" +v7info.getid () + "A For Update"; This. Cdcdao.executeclobsql (Update_sql, "V_info", V7info.getvinfostr ());
/*** * @Method: Executeclobsql * @Description: Update clob field *@paramUpdate_sql *@paramcolumn Field name data for this field *@return * @throwsSQLException *@throwsException *@authorLiuz * @date 2016-3-28*/ Public voidExecuteclobsql (String update_sql,string column,string data)throwsSQLException, Exception {if((myjdbctemplate) This. Getjdbctemplate ()). Isneed_encode ()) {Update_sql=NewString (Update_sql.getbytes ((myjdbctemplate) This. Getjdbctemplate ()). Getapp_encode ()), ((myjdbctemplate) This. Getjdbctemplate ()). Getdb_encode ()); } PreparedStatement P=NULL; ResultSet RS=NULL; Try{Connection conn= This. getconnection (); Conn.setautocommit (false); P=Pasersql (conn, update_sql); RS=conn.createstatement (). ExecuteQuery (Update_sql); if(Rs.next ()) {/*remove this Clob object*/Oracle.sql.CLOB CLOB=NULL; CLOB=(Oracle.sql.CLOB) rs.getclob (column); /*writing data to a Clob object*/BufferedWriter out=NewBufferedWriter (Clob. Getcharacteroutputstream ()); Out.write (data); Out.flush (); Out.close (); } rs.close (); Conn.commit (); Conn.setautocommit (true); } finally { if(rs! =NULL) { Try{rs.close (); } Catch(SQLException e) {e.printstacktrace (); } } if(P! =NULL) { Try{p.close (); } Catch(SQLException e) {e.printstacktrace (); } } } }
Hardships Daoteng Warehousing, colleagues said a sentence "Why to change the underlying code?" ”。 After popping a melodious keyboard sound, change back to the original way. The field is inserted normally with String. The result is: normal storage. 、、、、、、、、、、 tears ben!!!!
String sql = "INSERT INTO Cp_v_info" + "(ID," + ... ") V_info, "+ ... " VERSION) VALUES (?,?,?,?,?,?,?,?,?,?, "+ "?,?,?,?,?,?,?,?,?,?, "+ "?,?,?,?,?,?,?,?,?,?, "+ "?) " ; This . Cdcdao.executesql (SQL, V7info.getid (), ... V7info.getvinfo (),//String type ... V7info.getversion ()); /* ******** End ********* */
Oracle handles CLOB type data warehousing (string warehousing)