you should use executeUpdate()
to do updates to database instead of executeQuery()
method and executeUpdate()
doesn't return a ResultSet
.
pst.executeUpdate();
not
ResultSet executeQuery = pst.executeQuery();//not correct
don't know why you have commented that line.presumably that's why you don't get any error
manpreet
Best Answer
2 years ago
I'm designing a GUI using Java Netbeans and am trying to insert values into the table from the GUI fields. It shows no error , but nothing is getting inserted. Here is my code :