4

If I don't care about the number of rows updated, is there any advantage gained by using java.sql.Statement#executeUpdate() instead of java.sql.Statement#execute() for an UPDATE statement?

2 Answers 2

3

The return value differs. ExecuteUpdate() returns the number of rows updated, which can be useful when running an update statement. but you do not needed that one.So you can use any of them .Nothing you will get advantage.

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

Comments

1

My opinion is that there is no difference.

You will not find in any document about the Statement class that states that there is a performance difference between the two commands. Also as discussed in OTN people agree that there is no difference between the two.

Comments

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.