📄 register.jsp
字号:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page import="com.iss.dataBase.*" %>
<%@ page import="java.sql.*" %>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%--
This example uses JSTL, uncomment the taglib directive above.
To test, display the page like this: index.jsp?sayHello=true&name=Murphy
--%>
<%--
<c:if test="${param.sayHello}">
<!-- Let's welcome the user ${param.name} -->
Hello ${param.name}!
</c:if>
--%>
<%
Statement stmt= SQLParser.getInstance().getStmt();
String customerName=request.getParameter("customerName");
String mail=request.getParameter("mail");
String CreditCd=request.getParameter("CreditCd");
String ED=request.getParameter("ED");
String PhoneNo=request.getParameter("PhoneNo");
String Email=request.getParameter("Email");
String password=request.getParameter("password");
String sql="select * from customer order by id desc";
ResultSet rs=stmt.executeQuery(sql);
int temp;
if(rs.next()) temp=rs.getInt("id");
else temp=0;
sql="insert into customer values ("+(temp+1)+",'"+customerName+"','"+mail+"','"+CreditCd+"','"+ED+"','"+PhoneNo+"','"+Email+"','"+password+"')";
stmt.executeUpdate(sql);
session.setAttribute("customerName",customerName);
session.setAttribute("check","1");
out.println("<html><title></title><head></head><body>");
out.println("注册成功,请返回<a href='index.jsp'>首页</a>");
out.println("</body></html>");
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -