📄 acts_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
public final class actS_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=GB18030");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write(" \n");
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
out.write("<html>\n");
out.write("<head>\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=GB18030\">\n");
out.write("<title>Insert title here</title>\r\n");
out.write("<style TYPE=\"text/css\">\r\n");
out.write("<!--\r\n");
out.write("A:link{text-decoration:none}\r\n");
out.write("A:visited{text-decoration:none}\r\n");
out.write("A:hover {color: #ff00ff;text-decoration:underline}\r\n");
out.write(" -->\r\n");
out.write("</style>\n");
out.write("</head>\n");
out.write("<body background=\"image/tag.jpg\">\n");
String item=new String(request.getParameter("item").getBytes("8859_1"));
String value=new String(request.getParameter("value").getBytes("8859_1"));
out.write('\n');
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
String url="jdbc:sqlserver://localhost:1433;DatabaseName=HF";
//pubs为你的数据库的
String user="sa";
String password="123";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement();
String sql="select * from guests where "+item +" like'%"+value+ "%'";
ResultSet rs=stmt.executeQuery(sql);
out.write("\r\n");
out.write("<table border=\"1\" width=\"100%\">\r\n");
out.write("<tr align=center>\r\n");
out.write("<td >房间号</td><td>名字</td><td>性别</td><td>年龄</td><td>证件类型</td><td>证件号</td><td>国籍</td>\r\n");
out.write("<td>到达时间</td><td>拟走时间</td><td>价格</td>\r\n");
out.write("<td>备注</td>\r\n");
out.write("</tr>\r\n");
while(rs.next()) {
String roomno=rs.getString("roomcode");
String name=rs.getString("name");
String sex=rs.getString("sex");
String age=rs.getString("age");
String certclass=rs.getString("certclassno");
String certno=rs.getString("certificate");
String country=rs.getString("countryno");
String price=rs.getString("price");
String arrtime=rs.getDate(8).toString();
String leftime=rs.getDate(9).toString();
String remarks=rs.getString("remarks");
out.write("\r\n");
out.write("\r\n");
out.write("<tr align=center>\r\n");
out.write("<td>");
out.print(roomno );
out.write("</td>\r\n");
out.write("<td>");
out.print(name);
out.write("</td>\r\n");
out.write("<td>");
out.print(sex );
out.write("</td>\r\n");
out.write("<td>");
out.print(age );
out.write("</td>\r\n");
out.write("<td>");
out.print(certclass );
out.write("</td>\r\n");
out.write("<td>");
out.print(certno);
out.write("</td>\r\n");
out.write("<td>");
out.print(country );
out.write("</td>\r\n");
out.write("<td>");
out.print(arrtime );
out.write("</td>\r\n");
out.write("<td>");
out.print(leftime );
out.write("</td>\r\n");
out.write("<td>");
out.print(price );
out.write("</td>\r\n");
out.write("<td>");
out.print(remarks );
out.write("</td>\r\n");
out.write("</tr>\r\n");
out.write("\r\n");
out.write("\r\n");
}
out.write("\r\n");
out.write("</table>\r\n");
out.write("<p>\r\n");
out.write("<p>\r\n");
out.write("<font face=\"华文新魏\"size=4 color=\"#FF00FF\">\r\n");
out.write(" <a href=simlook.jsp target=sbut >简单查找</a></font>\r\n");
out.write(" <font face=\"华文新魏\"size=4 color=\"#FF00FF\">\r\n");
out.write(" <a href=sbut.jsp target=sbut >高级查找</a></font></p>\r\n");
out.write("</body>\n");
out.write("</html>");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -