当前位置: 技术问答>java相关
为什么我用ResultSet对象中的deleteRow()方法无法删除数据行?
来源: 互联网 发布时间:2015-08-05
本文导语: 我用了,程序如下: ResultSet rs=st.executeQuery(sql); while (rs.next()) if ((i++)!=iRow) continue; else { rs.deleteRow(); break; } 每次进入页面后...
我用了,程序如下:
ResultSet rs=st.executeQuery(sql);
while (rs.next())
if ((i++)!=iRow) continue;
else { rs.deleteRow();
break;
}
每次进入页面后出现错误:非法的游标位置,未定义键集。
到底是什么意思啊,怎么解决呢?
急!
ResultSet rs=st.executeQuery(sql);
while (rs.next())
if ((i++)!=iRow) continue;
else { rs.deleteRow();
break;
}
每次进入页面后出现错误:非法的游标位置,未定义键集。
到底是什么意思啊,怎么解决呢?
急!
|
rs.deleteRow(); 是jdbc2.0中ResultSet的方法。
Statement st = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
Statement st = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
|
public void deleteRow()
Deletes the current row from this ResultSet object and from the underlying database. This method cannot be called when the cursor is on the insert row.
Deletes the current row from this ResultSet object and from the underlying database. This method cannot be called when the cursor is on the insert row.