What's the difference and when should I use executeQuery()
or executeUpdate()
?
What's the difference and when should I use executeQuery()
or executeUpdate()
?
I imagine that it is without the point, if it is with the point I would have to find out what you are talking about.
executeQuery()
as the name itself says, it is for queries, it almost always uses 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, you should use a written command like INSERT
, UPDATE
and DELETE
, and it returns what has been affected and not a result of data.