0

它返回选择列的当前值,我只需要返回原始值来检查值是否真的改变了。

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

1 回答 1

2
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");
      }    
  }
}
于 2015-11-25T03:36:05.693 回答