Skip to content
Advertisement

Can not issue data manipulation statements with executeQuery

I’m getting an error when im trying to run my gui to inset data into a table, the error being Can not issue data manipulation statements with executeQuery(). The goal of this gui is to get the user to input information into the text area and then click submit and this information is uploaded to the database.

error : java.sql.SQLException: Can not issue data manipulation statements with executeQuery().

my code is

JavaScript

and this is the table im using

JavaScript

Advertisement

Answer

You have to use this method PreparedStatement#executeUpdate() instead of executeQuery

Executes the SQL statement in this PreparedStatement object, which must be an SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

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