⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ginfo_jsp.java

📁 酒店前台管理
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;

public final class ginfo_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("     \r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=GB18030\">\r\n");
      out.write("<title>Insert title here</title>\r\n");
      out.write("</head>\r\n");
      out.write("<body background=\"image/tag.jpg\">\r\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"; 
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("</body>\r\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 + -