On 2/5/22 10:52 AM, John English wrote:
On 05/02/2022 20:10, Rick Hillegas wrote:
I don't think you need the FOR UPDATE clause. The following simpler
code works for me:
try (Statement updatable =
conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_UPDATABLE))
{
try (ResultSet rs = updatable.executeQuery(SELECT_ALL))
{
while(rs.next())
{
rs.updateInt(1, 10 * rs.getInt(1));
rs.updateRow();
}
}
What if you want to update just one specific row? Can you use the same
technique for that?
Yes. You just have to position yourself on that row. Cheers