Example usage for javax.sql RowSet updateRow

List of usage examples for javax.sql RowSet updateRow

Introduction

In this page you can find the example usage for javax.sql RowSet updateRow.

Prototype

void updateRow() throws SQLException;

Source Link

Document

Updates the underlying database with the new contents of the current row of this ResultSet object.

Usage

From source file:ViewDB.java

 /**
 * Updates changed data into the current row of the row set
 *///from ww  w .  j  a  v  a 2  s. c om
public void setRow(RowSet rs) throws SQLException
{
   for (int i = 1; i <= fields.size(); i++)
   {
      String field = rs.getString(i);
      JTextField tb = (JTextField) fields.get(i - 1);
      if (!field.equals(tb.getText()))
         rs.updateString(i, tb.getText());
   }
   rs.updateRow();
}