Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can I update current row in the ResultSet?

807603Feb 12 2008 — edited Feb 14 2008
There 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!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 13 2008
Added on Feb 12 2008
29 comments
514 views