difference between executeQuery and executeUpdate

I am new in may current job. I have a program that make a INSERT using executeQuery. The program is in production and I don't change to executeUpdate. this is a problem?

thanks

[190 byte] By [AlberAlbanDeVrila] at [2007-11-27 11:14:27]
# 1

executeQuery is for queries that return ResultSets (like SELECT)

executeUpdate is for queries that do not return ResultSets. (like INSERT, UPDATE, DELETE)

So if you have an INSERT query that is using executeQuery it is wrong. Many drivers will throw an exception if you do this, if you are saying that yours is not throwing an exception then you are very lucky but you should still fix it.

cotton.ma at 2007-7-29 14:06:59 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...