0
我想从我的“学生”表中删除记录,该表有两列rollno和学生名称。我正在使用PreparedStatement
但我收到了一些错误。我无法理解错误。错误是:删除语句中的语法错误
您的SQL语法错误;检查与您的MySQL服务器版本相对应的手册,在'?'附近使用正确的语法。在1号线
这里是我的代码
String query = "delete from student where rollno = ?";
PreparedStatement pst = con.prepareStatement(query);
pst.setInt(1, 7);
pst.executeUpdate(query);
你忘了分享最重要的部分:你如何执行查询? – BackSlash