How to update values in JDBC using Resultset
<p>I want to chang all thd "id"'s values to int k, using ResultsSet.</p>

<p>I am having errors-null exception.</p>

<p>I get the error at the updateInt("ID",k);</p>

<p>Error:
"Cannot suppress a null exception. Self-suppression not permitted"</p>

<pre><code>int k=1;
try {
    Class.forName("org.apache.derby.jdbc.ClientDriver");
    String  urlCn="jdbc:derby://localhost:1527/myDb";
    Connection   cn = DriverManager.getConnection(urlCn, "omer", "1234");
    Statement stmt = cn.createStatement();
    String sql = "SELECT * FROM QUESTIONS";
    ResultSet rs = stmt.executeQuery(sql);
    while (rs.next()) {
        if(rs.getInt("ID")!=k)
            rs.updateInt("ID", k);
        k++;
    }
    rs.close();
    cn.close();
}
catch (ClassNotFoundException ex) {
    Logger.getLogger(addQuestion.class.getName()).log(Level.SEVERE, null, ex);
}           
catch (SQLException ex) {
    Logger.getLogger(addQuestion.class.getName()).log(Level.SEVERE, null, ex);
}
</code></pre>