用户验证的代码是什么啊?
请写上的代码吧!拜托!
给你传个mysql的 驱动WEB-INF\lib下mysql-connector-java-3.1.8-bin
提交后的页面
<%
try{
String loginName = request.getParameter("loginName");
String password = request.getParameter("password");
Class.forName("com.mysql.jdbc.Driver");
String dbUrl ="jdbc:mysql://localhost:3306/frm";
String dbUser="root";
String dbPwd ="root";
Connection con = DriverManager.getConnection(dbUrl,dbUser,dbPwd);
Statement stmt = con.createStatement();
ResultSet rs=stmt.executeQuery("SELECT * from test where loginName='" + loginName + "' and password='" + password + "'");
if(rs.next()){
rs.close();
stmt.close();
con.close();
session.setAttribute("loginName",loginName);
response.sendRedirect("welcome.jsp");
}
else {
rs.close();
stmt.close();
con.close();
response.sendRedirect("failure.jsp");
}
}
catch(Exception e){
out.println(e.getMessage());
}
%>