登陆界面:login.jsp
登陆用户登录
用户名:
用户密码:
登录验证界面:conf.jsp
Class.forName("org.gjt.mm.mysql.Driver");
Connection conn = null;
String url = "jdbc:mysql://localhost:3306/tf";
String user = "root";
String password = "123";
conn = DriverManager.getConnection(url, user, password);
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
String name = request.getParameter("name");
byte b[] = name.getBytes("ISO-8859-1");
name = new String(b);
String password2 = request.getParameter("password");
String strSQL = "select * from member where name='" + name + "' and password='" + password2 + "'";
ResultSet rs = stmt.executeQuery(strSQL);
int count = 0;
while (rs.next()) {
count++;
}
if (count > 0) {
%>