Skip to Main Content

Java Database Connectivity (JDBC)


For appeals, questions and feedback about Oracle Forums, please email Please ask technical questions in the appropriate category. Thank you!

Statement::executeUpdate blocks if no row is affected on UPDATE

User_OKRQAOct 31 2022

When calling 'Statement::executeUpdate' it works fine and returns the number of affected rows for INSERT and UPDATE as long as a row is inserted or updated, or on INSERT a key constraint is violated.
However, if I do an UPDATE which due to the key does not change any row (in fact for the test, the table is empty) it never returns or throws an exception. It simply blocks till I kill my process.
The idea behind is :
default is updating existing records, but if this fails since key is not found,
the first record is inserted
It was already working, but in the meantime, the server had to be re-installed, so, I guess, it could be a server config issue, but no idea what.

Post Details
Added on Oct 31 2022