?? process.jsp
字號:
<%@page contentType="text/html;charset=gb2312" import="java.sql.*"%>
<jsp:useBean id="conn" class="dbBean.DBBean" scope="session"/>
<jsp:setProperty name="conn" property="connStr" value="jdbc:odbc:user"/>
<%
session.setMaxInactiveInterval(-1);
String username=request.getParameter("username");
username=new String(username.getBytes("8859_1"));
String password=request.getParameter("password");
username=new String(password.getBytes("8859_1"));
ResultSet rs=null;
String sql="select * from user where name='"+username+"' and password='"+password+"'";
rs=conn.executeQuery(sql);
if(rs.next())
{
session.setAttribute("loginId",rs.getString("id"));
session.setAttribute("username",rs.getString("name"));
rs.close();
conn.close();
response.sendRedirect("home.jsp");
}
else
{
rs.close();
conn.close();
response.sendRedirect("login.htm");
}
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -