0

Hi there!

I'm building a small application using Java and MySQL (college assignment).
Everything is ok when all I'm doing are queries using SELECT.
Now, when I try to INSERT anything in the table, I get this error message:

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

Ok, so I should use something else other than executeQuery to manipulate data (and I suppose the same will happen if I try to UPDATE the table as well).

So, please, what should I use? I tried other methods from NetBeans but did not quite understand how to use them.

This is the code I'm using:

Statement statement=conn.createStatement();
            ResultSet resultSet=statement.executeQuery(sqlstring);

Thanks!!

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by masijade
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.