When the following error occurs:
Java.sql.SQLException:Can not issue data manipulation statements with executeQuery ().
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:1075)
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:989)
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:984)
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:929)
At Com.mysql.jdbc.StatementImpl.checkForDml (statementimpl.java:436)
At Com.mysql.jdbc.PreparedStatement.executeQuery (preparedstatement.java:2176)
At Org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery (delegatingpreparedstatement.java:96)
At Org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery (delegatingpreparedstatement.java:96)
At Com.cp.dsd.UserDAO.insert (userdao.java:33)
At Com.cp.dsd.SpringDAODemo.main (springdaodemo.java:16)
The reason is that when you do an INSERT, update, and so on, you cannot use the statement executequery () method to change to the Execute () method.
Problems with the spring JDBC application MySQL Database