解决方案:没有指定参数
String user = req.getParameter("user"); String pwd = req.getParameter("pwd"); Connection conn = DbUtil.getCon(); String sql = "select name from user where name=? and password=?"; PreparedStatement pst = conn.prepareStatement(sql); pst.setString(1, user); pst.setString(2, pwd);
时间: 2024-11-10 13:24:14