更新resultset,效率低

 
  1. //标准获取Statement 方法 
  2. Statement stmt = (Statement) conn.createStatement(); 
  3.  
  4. //获取可更新ResultSet 
  5. Statement stmt = (Statement) conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE); 

 

 
  1. long s = System.currentTimeMillis(); 
  2. while(rs.next()){ 
  3. //调用其他的update方法 
  4. //  updateDate(conn,rs.getString(“id”)); 
  5.  
  6.     rs.updateString(“age”, rs.getString(“id”)); 
  7.     rs.updateRow(); // updates the row in the data source 
  8.     System.out.println(rs.getString(“id”)); 
  9. long e = System.currentTimeMillis();