Skip to content
Advertisement

Cannot issue data manipulation statements with executeQuery()

In MySQL I have two tables, tableA and tableB. I am trying to execute two queries:

JavaScript

But I get the following error:

JavaScript

What does this mean?

Advertisement

Answer

To manipulate data you actually need executeUpdate() rather than executeQuery().

Here’s an extract from the executeUpdate() javadoc which is already an answer at its own:

Executes the given SQL statement, which may be an INSERT, UPDATE, or DELETE statement or an SQL statement that returns nothing, such as an SQL DDL statement.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement