可更新resultset,效率低
- //标准获取Statement 方法
- Statement stmt = (Statement) conn.createStatement();
- //获取可更新ResultSet
- Statement stmt = (Statement) conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
- long s = System.currentTimeMillis();
- while(rs.next()){
- //调用其他的update方法
- // updateDate(conn,rs.getString("id"));
- rs.updateString("age", rs.getString("id"));
- rs.updateRow(); // updates the row in the data source
- System.out.println(rs.getString("id"));
- }
- long e = System.currentTimeMillis();