⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 checkuser.jsp

📁 Easy_Buy是一个在线销售系统
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="pool" scope="application" class="PoolBean"/>
<html>
<head>
<title>正在检查用户信息,请稍后......</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<center>
  正在检查用户信息,请稍后......
<%
	String username=new String(request.getParameter("username").getBytes("8859_1"));
	String password=new String(request.getParameter("password").getBytes("8859_1"));

	Connection conn=pool.getConnection();
	Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);  
	String sql="SELECT * FROM Customers WHERE Username='"+username+"'"; 
	ResultSet rsLogin=stmt.executeQuery(sql);

	if(!rsLogin.next()){
		response.sendRedirect("loginFailure.jsp");
	}else if(!password.equals(rsLogin.getString("Password"))){
		response.sendRedirect("loginFailure.jsp");
	}else{
		session.putValue("username",username); 
		response.sendRedirect("index.jsp");
	}

	rsLogin.close();
	stmt.close();
	pool.releaseConnection(conn);
%>
</center>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -