它返回选择列的当前值,我所需要的就是返回原始值,以检查该值是否确实更改。

while(rs.next()){
    if (rs.rowUpdated){
        String strOrigVal = "";
        rs.getOriginalRow();
        strOrigVal = rs.getString("col1");
    }
}

最佳答案

ResultSet getOriginalRow()
                     throws SQLException



while(rs.next()){
  if (rs.rowUpdated){
      String strOrigVal = "";
      ResultSet ors = rs.getOriginalRow(); //you should catch the return value
      if(ors.next()){ //move to the first cursor
        strOrigVal = ors.getString("col1");
      }
  }
}

07-27 19:16