oracle 错误:未锁定含有 LOB 值的行

来源:百度知道 编辑:UC知道 时间:2024/05/30 03:53:45
java中向oracle存储过程写入clob值时,将clobWriter关闭时报了这样的错误:java.io.IOException: ORA-22920: 未锁定含有 LOB 值的行
代码如下:
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
con=DriverManager.getConnection(
"jdbc:oracle:thin:@172.30.11.13:1521:jhtest", "hgjks",
"hgjks");
String sql=
"Insert into t_clob(c_clob,c_id) VALUES(EMPTY_CLOB(),'1')";
pstmt=con.prepareStatement(sql);
pstmt.execute(sql);
pstmt.close();
Statement stmt=con.createStatement();
//插入clob begin
//

ResultSet rs=stmt.executeQuery(
"SELECT c_clob FROM t_clob "+
"WHERE c_id='1'");
rs.next();
Clob sugBookClob=rs.getC

朋友你好:
ORACLE官方文档对该错误的说明:
ORA-22920 row containing the LOB value is not locked

Cause: The row containing the LOB value must be locked before updating the LOB value.

Action: Lock the row containing the LOB value before updating the LOB value.
===============================================
参考文档如下:http://203.208.35.101/custom?q=cache:vGz-L0p1HsgJ:topic.csdn.net/t/20050216/18/3786164.html+22920+ora&hl=zh-CN&ct=clnk&cd=4&gl=cn&st_usg=ALhdy28RXpQYf4Iy278-hdaO2kT-l0trqQ

文档2:http://dev.csdn.net/Develop/article/16/16522.shtm

祝你成功!