jsp删除数据库记录问题
Stringid=request.getParameter("user");Class.forName("com.mysql.jdbc.Driver");Connecti...
String id = request.getParameter("user");
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/student?user=root&password=root");
Statement st = con.createStatement();
String str = "DELETE FROM user WHERE id="+id+"";
st.executeUpdate(str);
运行报错,报的是最后一行的错
str语句输出DELETE FROM user WHERE id=1 展开
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/student?user=root&password=root");
Statement st = con.createStatement();
String str = "DELETE FROM user WHERE id="+id+"";
st.executeUpdate(str);
运行报错,报的是最后一行的错
str语句输出DELETE FROM user WHERE id=1 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询