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

Jsp/Servlet

开发平台:

VBScript

  1. import java.sql.*;
  2. import java.util.*;
  3. import proj112.*;
  4. import javax.servlet.*;
  5. import javax.servlet.http.*;
  6. import javax.servlet.jsp.*;
  7. import org.apache.jasper.runtime.*;
  8. public class chakan1_0002ejsp_jsp extends HttpJspBase {
  9.     // begin [file="/chakan1.jsp";from=(5,0);to=(5,57)]
  10.     // end
  11.     static {
  12.     }
  13.     public chakan1_0002ejsp_jsp( ) {
  14.     }
  15.     private static boolean _jspx_inited = false;
  16.     public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
  17.     }
  18.     public void _jspService(HttpServletRequest request, HttpServletResponse  response)
  19.         throws java.io.IOException, ServletException {
  20.         JspFactory _jspxFactory = null;
  21.         PageContext pageContext = null;
  22.         HttpSession session = null;
  23.         ServletContext application = null;
  24.         ServletConfig config = null;
  25.         JspWriter out = null;
  26.         Object page = this;
  27.         String  _value = null;
  28.         try {
  29.             if (_jspx_inited == false) {
  30.                 synchronized (this) {
  31.                     if (_jspx_inited == false) {
  32.                         _jspx_init();
  33.                         _jspx_inited = true;
  34.                     }
  35.                 }
  36.             }
  37.             _jspxFactory = JspFactory.getDefaultFactory();
  38.             response.setContentType("text/html; charset=GBK");
  39.             pageContext = _jspxFactory.getPageContext(this, request, response,
  40.              "", true, 8192, true);
  41.             application = pageContext.getServletContext();
  42.             config = pageContext.getServletConfig();
  43.             session = pageContext.getSession();
  44.             out = pageContext.getOut();
  45.             // HTML // begin [file="/chakan1.jsp";from=(0,48);to=(1,0)]
  46.                 out.write("rn");
  47.             // end
  48.             // HTML // begin [file="/chakan1.jsp";from=(1,31);to=(2,0)]
  49.                 out.write("rn");
  50.             // end
  51.             // HTML // begin [file="/chakan1.jsp";from=(2,27);to=(3,0)]
  52.                 out.write("rn");
  53.             // end
  54.             // HTML // begin [file="/chakan1.jsp";from=(3,32);to=(4,0)]
  55.                 out.write("rn");
  56.             // end
  57.             // HTML // begin [file="/chakan1.jsp";from=(4,30);to=(5,0)]
  58.                 out.write("rn");
  59.             // end
  60.             // begin [file="/chakan1.jsp";from=(5,0);to=(5,57)]
  61.                 proj112.dbconn a = null;
  62.                 boolean _jspx_speciala  = false;
  63.                  synchronized (pageContext) {
  64.                     a= (proj112.dbconn)
  65.                     pageContext.getAttribute("a",PageContext.PAGE_SCOPE);
  66.                     if ( a == null ) {
  67.                         _jspx_speciala = true;
  68.                         try {
  69.                             a = (proj112.dbconn) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "proj112.dbconn");
  70.                         } catch (ClassNotFoundException exc) {
  71.                              throw new InstantiationException(exc.getMessage());
  72.                         } catch (Exception exc) {
  73.                              throw new ServletException (" Cannot create bean of class "+"proj112.dbconn", exc);
  74.                         }
  75.                         pageContext.setAttribute("a", a, PageContext.PAGE_SCOPE);
  76.                     }
  77.                  } 
  78.                 if(_jspx_speciala == true) {
  79.             // end
  80.             // begin [file="/chakan1.jsp";from=(5,0);to=(5,57)]
  81.                 }
  82.             // end
  83.             // HTML // begin [file="/chakan1.jsp";from=(5,57);to=(14,3)]
  84.                 out.write("rn<html>rn<head>rn<title>rnxuanke_1rn</title>rn</head>rn<body bgcolor="#ffffff">rnrn   ");
  85.             // end
  86.             // begin [file="/chakan1.jsp";from=(14,5);to=(25,5)]
  87.                   String stu_id=request.getParameter("stu_id");
  88.                        int totalrecord = 0;
  89.                        String sql="";
  90.                        String sql1="";
  91.                        String sql2="";
  92.                        String name="";
  93.                        sql="SELECT * FROM student where stu_id='"+stu_id+"'";
  94.                        ResultSet rs=a.executeQuery(sql);
  95.                  if(rs.next())
  96.                    {
  97.                      name=rs.getString("stu_name");
  98.                      
  99.             // end
  100.             // HTML // begin [file="/chakan1.jsp";from=(25,7);to=(26,31)]
  101.                 out.write("rn     <br> 学号:<font color="red">");
  102.             // end
  103.             // begin [file="/chakan1.jsp";from=(26,34);to=(26,41)]
  104.                 out.print(stu_id );
  105.             // end
  106.             // HTML // begin [file="/chakan1.jsp";from=(26,43);to=(26,84)]
  107.                 out.write("</font>&nbsp;&nbsp; 姓名:<font color="red">");
  108.             // end
  109.             // begin [file="/chakan1.jsp";from=(26,87);to=(26,92)]
  110.                 out.print(name );
  111.             // end
  112.             // HTML // begin [file="/chakan1.jsp";from=(26,94);to=(27,5)]
  113.                 out.write("</font>,所学基本课程成绩如下:<br><br><hr><br><br>rn     ");
  114.             // end
  115.             // begin [file="/chakan1.jsp";from=(27,7);to=(36,9)]
  116.                   sql1 = "SELECT count(*) as recordcount FROM 成绩关联 where stu_id='"+stu_id+"'";
  117.                      ResultSet bs = a.executeQuery(sql1);
  118.                         session.setAttribute("stu_id",stu_id);
  119.                      if (bs.next())
  120.                      {
  121.                        totalrecord = bs.getInt("recordcount");
  122.                        if(totalrecord!=0){
  123.                          sql2="SELECT * FROM chengji,成绩关联 where chengji.kch=成绩关联.课程号 and 成绩关联.stu_id='"+stu_id+"'";
  124.                          ResultSet ts=a.executeQuery(sql2);
  125.                          
  126.             // end
  127.             // HTML // begin [file="/chakan1.jsp";from=(36,11);to=(49,13)]
  128.                 out.write("rn         <p align="center">rn      <table 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:100%;border-collapse:collapse;">rn             <tr>rn               <td align="center"><font color="#6633CC">学期号</font></td>rn               <td align="center"><font color="#6633CC">课程号</font></td>rn               <td align="center"><font color="#6633CC">课程名</font></td>rn               <td align="center"><font color="#6633CC">学分</font></td>rn               <td align="center"><font color="#6633CC">主讲教师</font></td>rn               <td align="center"><font color="#6633CC">成绩</font></td>rn               <td align="center"><font color="#6633CC">重修成绩</font></td>rn               <td align="center"><font color="#6633CC">成绩修改</font></td>rn             </tr>rn             ");
  129.             // end
  130.             // begin [file="/chakan1.jsp";from=(49,15);to=(50,30)]
  131.                 
  132.                              while(ts.next()){
  133.             // end
  134.             // HTML // begin [file="/chakan1.jsp";from=(50,32);to=(52,34)]
  135.                 out.write("rn             <tr>rn               <td align="center">");
  136.             // end
  137.             // begin [file="/chakan1.jsp";from=(52,37);to=(52,52)]
  138.                 out.print(ts.getString(1));
  139.             // end
  140.             // HTML // begin [file="/chakan1.jsp";from=(52,54);to=(52,59)]
  141.                 out.write("</td>");
  142.             // end
  143.             // begin [file="/chakan1.jsp";from=(52,61);to=(52,96)]
  144.                 String kechenghao=ts.getString(2); 
  145.             // end
  146.             // HTML // begin [file="/chakan1.jsp";from=(52,98);to=(53,34)]
  147.                 out.write("rn               <td align="center">");
  148.             // end
  149.             // begin [file="/chakan1.jsp";from=(53,37);to=(53,52)]
  150.                 out.print(ts.getString(2));
  151.             // end
  152.             // HTML // begin [file="/chakan1.jsp";from=(53,54);to=(54,34)]
  153.                 out.write("</td>rn               <td align="center">");
  154.             // end
  155.             // begin [file="/chakan1.jsp";from=(54,37);to=(54,52)]
  156.                 out.print(ts.getString(3));
  157.             // end
  158.             // HTML // begin [file="/chakan1.jsp";from=(54,54);to=(55,34)]
  159.                 out.write("</td>rn               <td align="center">");
  160.             // end
  161.             // begin [file="/chakan1.jsp";from=(55,37);to=(55,52)]
  162.                 out.print(ts.getString(4));
  163.             // end
  164.             // HTML // begin [file="/chakan1.jsp";from=(55,54);to=(56,34)]
  165.                 out.write("</td>rn               <td align="center">");
  166.             // end
  167.             // begin [file="/chakan1.jsp";from=(56,37);to=(56,52)]
  168.                 out.print(ts.getString(5));
  169.             // end
  170.             // HTML // begin [file="/chakan1.jsp";from=(56,54);to=(57,34)]
  171.                 out.write("</td>rn               <td align="center">");
  172.             // end
  173.             // begin [file="/chakan1.jsp";from=(57,37);to=(57,52)]
  174.                 out.print(ts.getString(9));
  175.             // end
  176.             // HTML // begin [file="/chakan1.jsp";from=(57,54);to=(58,34)]
  177.                 out.write("</td>rn               <td align="center">");
  178.             // end
  179.             // begin [file="/chakan1.jsp";from=(58,37);to=(58,53)]
  180.                 out.print(ts.getString(10));
  181.             // end
  182.             // HTML // begin [file="/chakan1.jsp";from=(58,55);to=(59,59)]
  183.                 out.write("</td>rn               <td align="center"><a href="chakan11.jsp?id=");
  184.             // end
  185.             // begin [file="/chakan1.jsp";from=(59,62);to=(59,72)]
  186.                 out.print(kechenghao);
  187.             // end
  188.             // HTML // begin [file="/chakan1.jsp";from=(59,74);to=(61,13)]
  189.                 out.write("">修改</a></td>rn             </tr>rn             ");
  190.             // end
  191.             // begin [file="/chakan1.jsp";from=(61,15);to=(61,17)]
  192.                 } 
  193.             // end
  194.             // HTML // begin [file="/chakan1.jsp";from=(61,19);to=(64,11)]
  195.                 out.write("rn           </table>rnrn           ");
  196.             // end
  197.             // begin [file="/chakan1.jsp";from=(64,13);to=(65,12)]
  198.                 }else
  199.                            {
  200.             // end
  201.             // HTML // begin [file="/chakan1.jsp";from=(65,14);to=(71,11)]
  202.                 out.write("rn           <script language="javascript">rn           alert("该学生没有成绩记录");rn           history.go(-1);rn           history.go(0);rn           </script>rn           ");
  203.             // end
  204.             // begin [file="/chakan1.jsp";from=(71,13);to=(73,12)]
  205.                 }
  206.                            }else
  207.                            {
  208.             // end
  209.             // HTML // begin [file="/chakan1.jsp";from=(73,14);to=(79,11)]
  210.                 out.write("rn           <script language="javascript">rn           alert("该学生没有成绩记录");rn           history.go(-1);rn           history.go(0);rn           </script>rn           ");
  211.             // end
  212.             // begin [file="/chakan1.jsp";from=(79,13);to=(82,6)]
  213.                 }
  214.                            }
  215.                    else
  216.                      {
  217.             // end
  218.             // HTML // begin [file="/chakan1.jsp";from=(82,8);to=(88,3)]
  219.                 out.write("rn     <script language="javascript">rn     alert("没有你输入的学生,请重新输入");rn     history.go(-1);rn     history.go(0);rn     </script>rn   ");
  220.             // end
  221.             // begin [file="/chakan1.jsp";from=(88,5);to=(89,6)]
  222.                 }
  223.                       
  224.             // end
  225.             // HTML // begin [file="/chakan1.jsp";from=(89,8);to=(96,0)]
  226.                 out.write("rn<br><br><br><br>rn <a href="chakan.jsp">返回</a>rnrn</body>rnrnrn");
  227.             // end
  228.         } catch (Throwable t) {
  229.             if (out != null && out.getBufferSize() != 0)
  230.                 out.clearBuffer();
  231.             if (pageContext != null) pageContext.handlePageException(t);
  232.         } finally {
  233.             if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
  234.         }
  235.     }
  236. }