Result set type is TYPE_FORWARD_ONLY是说你的结果记录集只向前滚动,你改成这样就可以了
stmt=conn.createStatement();改成
stmt=conn.createStatement(ResultSet.TYPE_SCROLL
_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
stmt=conn.createStatement();改成
stmt=conn.createStatement(ResultSet.TYPE_SCROLL
_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
改成下面这句
stmt = conn.createStatement(
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
rs.beforeFirst();//Moves the cursor to the front of this ResultSet object, just before the first row.
Error.
if you want a such use,please do as the follows:stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE) ;