jiangjin_0002ejsp_jsp.java
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:6k
源码类别:

Jsp/Servlet

开发平台:

VBScript

  1. import java.sql.*;
  2. import javax.servlet.*;
  3. import javax.servlet.http.*;
  4. import javax.servlet.jsp.*;
  5. import org.apache.jasper.runtime.*;
  6. public class jiangjin_0002ejsp_jsp extends HttpJspBase {
  7.     static {
  8.     }
  9.     public jiangjin_0002ejsp_jsp( ) {
  10.     }
  11.     private static boolean _jspx_inited = false;
  12.     public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
  13.     }
  14.     public void _jspService(HttpServletRequest request, HttpServletResponse  response)
  15.         throws java.io.IOException, ServletException {
  16.         JspFactory _jspxFactory = null;
  17.         PageContext pageContext = null;
  18.         HttpSession session = null;
  19.         ServletContext application = null;
  20.         ServletConfig config = null;
  21.         JspWriter out = null;
  22.         Object page = this;
  23.         String  _value = null;
  24.         try {
  25.             if (_jspx_inited == false) {
  26.                 synchronized (this) {
  27.                     if (_jspx_inited == false) {
  28.                         _jspx_init();
  29.                         _jspx_inited = true;
  30.                     }
  31.                 }
  32.             }
  33.             _jspxFactory = JspFactory.getDefaultFactory();
  34.             response.setContentType("text/html; charset=GBK");
  35.             pageContext = _jspxFactory.getPageContext(this, request, response,
  36.              "", true, 8192, true);
  37.             application = pageContext.getServletContext();
  38.             config = pageContext.getServletConfig();
  39.             session = pageContext.getSession();
  40.             out = pageContext.getOut();
  41.             // HTML // begin [file="/jiangjin.jsp";from=(0,48);to=(1,0)]
  42.                 out.write("rn");
  43.             // end
  44.             // HTML // begin [file="/jiangjin.jsp";from=(1,31);to=(2,0)]
  45.                 out.write("rn");
  46.             // end
  47.             // HTML // begin [file="/jiangjin.jsp";from=(2,27);to=(15,0)]
  48.                 out.write("rn<HTML>rn<HEAD>rn<TITLE></TITLE>rn</HEAD>rn<BODY>rn<CENTER>rn<FONT SIZE = 5 COLOR = blue>获奖同学如下</FONT>rn</CENTER>rn<BR>rn<HR>rn<BR>rn<CENTER>rn");
  49.             // end
  50.             // begin [file="/jiangjin.jsp";from=(15,2);to=(21,0)]
  51.                 
  52.                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //载入驱动程序类别
  53.                 Connection con = DriverManager.getConnection("jdbc:odbc:dsn112"); //建立数据库链接
  54.                 Statement stmt = con.createStatement(); //建立Statement对象
  55.                 ResultSet rs; //建立ResultSet(结果集)对象
  56.                 rs = stmt.executeQuery("SELECT * FROM jiangjin"); //执行SQL语句
  57.             // end
  58.             // HTML // begin [file="/jiangjin.jsp";from=(21,2);to=(27,1)]
  59.                 out.write("rn<table  width="100%" cellspacing="0" cellpadding="4" rules="all" bordercolor="#CC9966" border="1" id="dg_rxkb" style="background-color:White;border-color:#CC9966;border-width:1px;border-style:None;width:99%;border-collapse:collapse;">rnt<TR  bgcolor="#EcEcff">rnt<TD><B>学   号</B></TD><TD><B>姓  名</B></TD><TD><B>性  别</B></TD>rn        <TD><B>专  业</B></TD><TD><B>班  级</B></TD><TD><B>奖  金</B></TD>rnt</TR>rnt");
  60.             // end
  61.             // begin [file="/jiangjin.jsp";from=(27,3);to=(31,2)]
  62.                 
  63.                  //利用while循环将数据表中的记录列出
  64.                  while (rs.next())
  65.                  {
  66.                 
  67.             // end
  68.             // HTML // begin [file="/jiangjin.jsp";from=(31,4);to=(33,9)]
  69.                 out.write("rntt<TR bgcolor=white>rntt<TD><B>");
  70.             // end
  71.             // begin [file="/jiangjin.jsp";from=(33,12);to=(33,36)]
  72.                 out.print( rs.getString("stu_id") );
  73.             // end
  74.             // HTML // begin [file="/jiangjin.jsp";from=(33,38);to=(34,9)]
  75.                 out.write("</B></TD>rntt<TD><B>");
  76.             // end
  77.             // begin [file="/jiangjin.jsp";from=(34,12);to=(34,34)]
  78.                 out.print( rs.getString("name") );
  79.             // end
  80.             // HTML // begin [file="/jiangjin.jsp";from=(34,36);to=(35,9)]
  81.                 out.write("</B></TD>rntt<TD><B>");
  82.             // end
  83.             // begin [file="/jiangjin.jsp";from=(35,12);to=(35,33)]
  84.                 out.print( rs.getString("sex") );
  85.             // end
  86.             // HTML // begin [file="/jiangjin.jsp";from=(35,35);to=(36,23)]
  87.                 out.write("</B></TD>rn                <TD><B>");
  88.             // end
  89.             // begin [file="/jiangjin.jsp";from=(36,26);to=(36,48)]
  90.                 out.print( rs.getString("dept") );
  91.             // end
  92.             // HTML // begin [file="/jiangjin.jsp";from=(36,50);to=(37,23)]
  93.                 out.write("</B></TD>rn                <TD><B>");
  94.             // end
  95.             // begin [file="/jiangjin.jsp";from=(37,26);to=(37,49)]
  96.                 out.print( rs.getString("class") );
  97.             // end
  98.             // HTML // begin [file="/jiangjin.jsp";from=(37,51);to=(38,23)]
  99.                 out.write("</B></TD>rn                <TD><B>");
  100.             // end
  101.             // begin [file="/jiangjin.jsp";from=(38,26);to=(38,52)]
  102.                 out.print( rs.getString("jiangjin") );
  103.             // end
  104.             // HTML // begin [file="/jiangjin.jsp";from=(38,54);to=(40,2)]
  105.                 out.write("</B></TD>rntt</TR>rntt");
  106.             // end
  107.             // begin [file="/jiangjin.jsp";from=(40,4);to=(45,1)]
  108.                 
  109.                  }
  110.                  rs.close(); //关闭ResultSet对象
  111.                  stmt.close(); //关闭Statement对象
  112.                  con.close();  //关闭Connection对象
  113.                 
  114.             // end
  115.             // HTML // begin [file="/jiangjin.jsp";from=(45,3);to=(50,0)]
  116.                 out.write("rn</TABLE>rn</CENTER>rn</BODY>rn</HTML>rn");
  117.             // end
  118.         } catch (Throwable t) {
  119.             if (out != null && out.getBufferSize() != 0)
  120.                 out.clearBuffer();
  121.             if (pageContext != null) pageContext.handlePageException(t);
  122.         } finally {
  123.             if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
  124.         }
  125.     }
  126. }