简体   繁体   中英

How can i get the original values of specific column of cachedrowset?

it returns the current value of the select column, all i need is to return the original value for checking if the value really changed.

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");
      }    
  }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM