📄 chklogin.jsp~11~
字号:
<%@page import="taobaoproject.*" %>
<%@page import="java.sql.*" %>
<%
java.sql.PreparedStatement past;
java.sql.ResultSet rst;
String userid = request.getParameter("userid");
if (userid == null) {
userid = "";
}
String password = request.getParameter("password");
if (password == null) {
password = "";
}
DB_Bean dbBean = new DB_Bean();
java.sql.Connection conn = dbBean.getConn();
try {
past = conn.prepareStatement("select * from tb_Member where Name = ? and Psaaword = ?");
past.setString(1,userid);
past.setString(2,password);
rst = past.executeQuery();
if(!rst.next()) {
String errmsg = "error1";
response.sendRedirect("login.jsp?errmsg=" + errmsg);
return;
}
request.getSession(true);
String chk = "true";
session.putValue("Enter",chk);
session.putValue("username",rst.getString("Name"));
response.sendRedirect("index.jsp");
} catch (SQLException ex) {
java.lang.System.out.println(ex);
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -