title: ResultSet update row is not working
body: <p>I want to update raw in my ResultSet while I looping through the result set. Following is my code</p>
  
  <pre><code>try {
      String query="SELECT * FROM smsmessage WHERE recipient = ? and sent_status = 'pending' LIMIT ? ";
  PreparedStatement prepStmt = conn.prepareStatement(query);
      prepStmt.setString(1,shortCode);
      prepStmt.setInt(2, Integer.parseInt(batchSize));
      ResultSet rs=prepStmt.executeQuery();
      while (rs.next()) {
  
          //update the selected message sent status to "sent" from "pending"
          rs.updateString("sent_status","sent");
          rs.updateRow();
      }
  
  } catch (SQLException e) {
      log.error("MySQL exception",e);
  }
  </code></pre>
  
  <p>What should be the possible reason for this?</p>
  
  <p>I am getting following error</p>
  
  <blockquote>
    <p>com.mysql.jdbc.NotUpdatable: Result Set not updatable. This result set
    must come from a statement that was created with a  result set type of
    ResultSet.CONCUR_UPDATABLE, the query must select only one table, can
    not use functions and must select all primary keys from that table.
    See the JDBC 2.1 API Specification, section 5.6 for more details.This
    result set must come from a statement that was created with a  result
    set type of ResultSet.CONCUR_UPDATABLE, the query must select only one
    table, can not use functions and must select all primary keys from
    that table. See the JDBC 2.1 API Specification, section 5.6 for more
    details.</p>
  </blockquote>