📄 excute.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%@ page import="java.sql.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'excute.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<style>
<!--
a:link { color: #090094; text-decoration: none;font-size: 12px;}
a:visited { color: #090094; text-decoration: none;font-size: 12px;}
a:hover { color: #FF0000; text-decoration: underline;font-size: 12px;}
a:active { color: #090094; text-decoration: none;font-size: 12px;}
-->
</style>
</head>
<jsp:useBean id="guest" scope="session" class="db.DBCon" />
<body background="images/kite.gif">
<%
request.setCharacterEncoding("gb2312");
String roomno=(String)session.getAttribute("fname");
String name=request.getParameter("text1");
String sex=request.getParameter("radio1");
String age=request.getParameter("text2");
String certclass=request.getParameter("list1");
String certificate=request.getParameter("text3");
String country=request.getParameter("list2");
String arridate=request.getParameter("arridate");
String leftdate=request.getParameter("leftdate");
String price=request.getParameter("text6");
String remarks=request.getParameter("textarea1");
String roomcode;
String countryno;
String certno;
ResultSet rs=null;
String sql="select roomcode from room where roomno='"+roomno+"'";
try{
rs=guest.excuteQuery(sql);
rs.next();
roomcode=rs.getString(1);
sql="select countryno from countrycodes where country='"+country+"'";
rs=guest.excuteQuery(sql);
rs.next();
countryno=rs.getString(1);
sql="select certno from certclasses where certclass='"+certclass+"'";
rs=guest.excuteQuery(sql);
rs.next();
certno=rs.getString(1);
sql="update roomstate set roomstate='1' where roomcode='"+roomcode+"';";
guest.excuteUpdate(sql);
sql="insert into guests values('"+roomcode+"','"+name+"','"+sex+"',"+age+",'"+certno+"','"+certificate+"','"+
countryno+"','"+arridate+"','"+leftdate+"','"+remarks+"',"+price+");";
guest.excuteUpdate(sql);
rs.close();
guest.close();
%>
<table align='center'>
<tr>
<td>
<font size='4' face='楷体_gb2312'>恭喜你,登记成功!</font>
</td>
</tr>
<tr>
</tr>
<tr>
<td height="22px">
</td>
</tr>
<tr>
<td>
<a href="register.jsp?fname=<%=roomno%>" ><FONT size="4" color="#d86cfc" face="隶书">再登记</font></a> <a href="index.jsp"><FONT size="4" color="#d86cfc" face="隶书">回主目录</font></a>
</td>
</tr>
</table>
<%
}catch(Exception e){
out.println("更新出错!");
}
%>
<br>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -