What’s the difference between running and executing?

Asked

Viewed 498 times

1

What’s the difference and when to use executeQuery() or executeUpdate()?

  • Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful to you. You can also vote on any question or answer you find useful on the entire site.

1 answer

9

I imagine it’s without the point, if it’s with the point I’d have to figure out what you’re talking about.

executeQuery() as its name says, it is for consultations, almost always use a SELECT in it and a result will be returned with the data, or an error.

executeUpdate() as its name says, it is for updates, one should use a written command as INSERT, UPDATE and DELETE, and it returns what was affected and not a data result.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.