[color=green] stmt = conn.createStatement(1004, 1007);//1004表示可滚动的结果集,1007表示只读的 [/color]
[color=olive]ResultSet默认情况下:
Statement stmt = conn.createStatement(); //建立Statement物件
游标是只能向前移动的(Forward Only),在移动游标(比如:rs.last(),rs.first())时会抛出异常,所以需要在创建Statement时设置参数以实现移动游标:
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);[/color]
[color=olive]ResultSet默认情况下:
Statement stmt = conn.createStatement(); //建立Statement物件
游标是只能向前移动的(Forward Only),在移动游标(比如:rs.last(),rs.first())时会抛出异常,所以需要在创建Statement时设置参数以实现移动游标:
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);[/color]