oracle 寫入 blob 時,報“表或視圖不存在”錯誤

原來的代碼:

jdbcTemplate . update ( "INSERT INTO net_uploadcont (id, content, busiid) VALUES (?, ?, ?)" ,
netUploadcont . getId (),
netUploadcont . getContent (), netUploadcont . getBusiid ());
修改後的代碼
 
@ Override
public void insert ( NetUploadcont netUploadcont ) {

 

String sql = "INSERT INTO net_uploadcont (id,content,busiid)VALUES(?, ?,?)" ;

 

jdbcTemplate . execute ( sql , ( PreparedStatementCallback < Integer > ) preparedStatement -> {

{
// 設置ID
preparedStatement . setLong ( 1 , netUploadcont . getId ());
byte [] bytes = netUploadcont . getContent (). getBytes ( 1 , ( int ) netUploadcont . getContent (). length ());
preparedStatement . setBinaryStream ( 2 , new ByteArrayInputStream ( bytes ), bytes . length );
preparedStatement . setLong ( 3 , netUploadcont . getBusiid ());
// 執行更新
preparedStatement . executeUpdate ();
}

 

return 1 ; // 返回插入的記錄數

});

 

}

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