how to refresh the resultset

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RoyalScorpion

    how to refresh the resultset

    hi guys, i get an updatable resultset from a connection then used it
    to insert a new row but the result set doesn't chane after insertion,
    i mean the no of rows before insertion is the same after insertion and
    also the data, this is the code prove what i say

    int currentRow = resultset.getRo w();
    display(results et);
    resultset.moveT oInsertRow();
    for (int i = 0; i < fields.size(); i++)
    {
    updateCurrentRo w(resultset, fields.getField (i));
    }
    resultset.inser tRow();
    display(results et);

    the display function body is

    int currentRow = res.getRow();
    res.first();
    while (true)
    {
    System.out.prin tln("CountyCode = " + res.getInt(1));
    System.out.prin tln("CountyName = " + res.getString(2 ));
    if (!res.next())
    break;
    }
    res.absolute(cu rrentRow);

    Please help me

    N.B.
    the type of resultset after creation it is res.getConcurre ncy() ==
    ResultSet.CONCU R_UPDATABLE???? ?

    Thanks for your efforts
Working...