How can I update current row in the ResultSet?
807603Feb 12 2008 — edited Feb 14 2008There is no function for a resultset to update the current row...How will I do this..
Heres an example(using a preparedStatement)
---------------
updateStmt =conn.prepareStatement("UPDATE test, test1 SET new_shares = ? WHERE stock_code=Scode AND name_broker=Sbroker");
while(rset.next())
{
if(condition 1)
{
int a;
updateStmt.getInt("1, a");
updateStmt.executeUpdate();
}
else
{
int b;
updateStmt.getInt("1, b");
updateStmt.executeUpdate();
}
}
this is not the actual but i want some ideas from you guys.....
--------------------------
the updateStmt should update the current row but unfortunately it updates all the rows in the new_shares column when it updates......I need help guys..thanks!