The following query was successful when I used in mysql
INSERT INTO user(`dev_id`,`email`) VALUES('123','456@gmail.com');
But in java jdbc I got this exception:
Can not issue data manipulation statements with executeQuery().
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
at com.mysql.jdbc.Statement.checkForDml(Statement.java:417)
at com.mysql.jdbc.Statement.executeQuery(Statement.java:1140)
My table have 5 columns and 3 columns have default value =null;
executeQueryis only for issuing query statements. You need to be usingexecuteUpdatefor an insert, which is for statements (likeINSERT) that modify data. Ideally, you should also be using aPreparedStatement