ram
ram

Reputation: 29

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

Upvotes: 0

Views: 784

Answers (1)

Roger Dwan
Roger Dwan

Reputation: 770

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

Upvotes: 2

Related Questions