In my code I am using
String query= "delete all from myTable";
stmt.executeQuery(query);
Ideally for DML executeUpdate should be used instead. However, executeQuery too works well. So, was curious to know what could be the harm of using executeQuery instead of executeUpdate?
First, you don’t get the number of updated row.
Second, depends on the JDBC driver, your query may be failed.