1

What are the repercussions of using executeQuery rather than executeUpdate to update data in the database.

Thanks

1 Answer 1

0

executeQuery() returns a ResultSet, from which you have to retrieve the int result yourself. Moreover you have to close and release the resultset yourself.

Sign up to request clarification or add additional context in comments.

3 Comments

Which means that an extra effort would be required to get the updated rows. Also would there be a performance issue angle also involved ?
@Vivek No there is no performance difference between executeQuery() and executeUpdate(). Both call underlying execute() function.
@djaqeel That is an implementation detail of a specific driver, you cannot guarantee that a driver executes them both in the same way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.