Example usage for javax.sql RowSet updateString

List of usage examples for javax.sql RowSet updateString

Introduction

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

Prototype

void updateString(int columnIndex, String x) throws SQLException;

Source Link

Document

Updates the designated column with a String value.

Usage

From source file:ViewDB.java

 /**
 * Updates changed data into the current row of the row set
 *///ww w . j  av 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();
}