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

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 xuanxiuke1_0002ejsp_jsp extends HttpJspBase {
  9.     // begin [file="/xuanxiuke1.jsp";from=(5,0);to=(5,57)]
  10.     // end
  11.     static {
  12.     }
  13.     public xuanxiuke1_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="/xuanxiuke1.jsp";from=(0,48);to=(1,0)]
  46.                 out.write("rn");
  47.             // end
  48.             // HTML // begin [file="/xuanxiuke1.jsp";from=(1,31);to=(2,0)]
  49.                 out.write("rn");
  50.             // end
  51.             // HTML // begin [file="/xuanxiuke1.jsp";from=(2,27);to=(3,0)]
  52.                 out.write("rn");
  53.             // end
  54.             // HTML // begin [file="/xuanxiuke1.jsp";from=(3,32);to=(4,0)]
  55.                 out.write("rn");
  56.             // end
  57.             // HTML // begin [file="/xuanxiuke1.jsp";from=(4,30);to=(5,0)]
  58.                 out.write("rn");
  59.             // end
  60.             // begin [file="/xuanxiuke1.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="/xuanxiuke1.jsp";from=(5,0);to=(5,57)]
  81.                 }
  82.             // end
  83.             // HTML // begin [file="/xuanxiuke1.jsp";from=(5,57);to=(13,3)]
  84.                 out.write("rn<html>rn<head>rn<title>rnxuanke_1rn</title>rn</head>rn<body bgcolor="#ffffff">rn   ");
  85.             // end
  86.             // begin [file="/xuanxiuke1.jsp";from=(13,5);to=(25,5)]
  87.                 
  88.                        String stu_id=request.getParameter("stu_id");
  89.                        int totalrecord = 0;
  90.                        String sql="";
  91.                        String sql1="";
  92.                        String sql2="";
  93.                        String name="";
  94.                        sql="SELECT * FROM student where stu_id='"+stu_id+"'";
  95.                        ResultSet rs=a.executeQuery(sql);
  96.                  if(rs.next())
  97.                    {
  98.                      name=rs.getString("stu_name");
  99.                      
  100.             // end
  101.             // HTML // begin [file="/xuanxiuke1.jsp";from=(25,7);to=(26,31)]
  102.                 out.write("rn     <br> 学号:<font color="red">");
  103.             // end
  104.             // begin [file="/xuanxiuke1.jsp";from=(26,34);to=(26,41)]
  105.                 out.print(stu_id );
  106.             // end
  107.             // HTML // begin [file="/xuanxiuke1.jsp";from=(26,43);to=(26,84)]
  108.                 out.write("</font>&nbsp;&nbsp; 姓名:<font color="red">");
  109.             // end
  110.             // begin [file="/xuanxiuke1.jsp";from=(26,87);to=(26,92)]
  111.                 out.print(name );
  112.             // end
  113.             // HTML // begin [file="/xuanxiuke1.jsp";from=(26,94);to=(27,5)]
  114.                 out.write("</font>,所选修的课程如下:<br><br><hr><br><br>rn     ");
  115.             // end
  116.             // begin [file="/xuanxiuke1.jsp";from=(27,7);to=(35,9)]
  117.                   sql1 = "SELECT count(*) as recordcount FROM 选课关联 where stu_id='"+stu_id+"'";
  118.                      ResultSet bs = a.executeQuery(sql1);
  119.                      if (bs.next())
  120.                      {
  121.                        totalrecord = bs.getInt("recordcount");
  122.                        if(totalrecord!=0){
  123.                          sql2="SELECT * FROM 选课关联,kecheng where 选课关联.kch=kecheng.kch and 选课关联.stu_id='"+stu_id+"'";
  124.                          ResultSet ts=a.executeQuery(sql2);
  125.                          
  126.             // end
  127.             // HTML // begin [file="/xuanxiuke1.jsp";from=(35,11);to=(46,13)]
  128.                 out.write("rn         <p align="center">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: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             </tr>rn             ");
  129.             // end
  130.             // begin [file="/xuanxiuke1.jsp";from=(46,15);to=(47,30)]
  131.                 
  132.                              while(ts.next()){
  133.             // end
  134.             // HTML // begin [file="/xuanxiuke1.jsp";from=(47,32);to=(49,34)]
  135.                 out.write("rn             <tr>rn               <td align="center">");
  136.             // end
  137.             // begin [file="/xuanxiuke1.jsp";from=(49,37);to=(49,56)]
  138.                 out.print(ts.getString("kch"));
  139.             // end
  140.             // HTML // begin [file="/xuanxiuke1.jsp";from=(49,58);to=(50,34)]
  141.                 out.write("</td>rn               <td align="center">");
  142.             // end
  143.             // begin [file="/xuanxiuke1.jsp";from=(50,37);to=(50,56)]
  144.                 out.print(ts.getString("kcm"));
  145.             // end
  146.             // HTML // begin [file="/xuanxiuke1.jsp";from=(50,58);to=(51,34)]
  147.                 out.write("</td>rn               <td align="center">");
  148.             // end
  149.             // begin [file="/xuanxiuke1.jsp";from=(51,37);to=(51,57)]
  150.                 out.print(ts.getString("rkjs"));
  151.             // end
  152.             // HTML // begin [file="/xuanxiuke1.jsp";from=(51,59);to=(52,34)]
  153.                 out.write("</td>rn               <td align="center">");
  154.             // end
  155.             // begin [file="/xuanxiuke1.jsp";from=(52,37);to=(52,56)]
  156.                 out.print(ts.getString("xqj"));
  157.             // end
  158.             // HTML // begin [file="/xuanxiuke1.jsp";from=(52,58);to=(53,34)]
  159.                 out.write("</td>rn               <td align="center">");
  160.             // end
  161.             // begin [file="/xuanxiuke1.jsp";from=(53,37);to=(53,55)]
  162.                 out.print(ts.getString("sj"));
  163.             // end
  164.             // HTML // begin [file="/xuanxiuke1.jsp";from=(53,57);to=(54,34)]
  165.                 out.write("</td>rn               <td align="center">");
  166.             // end
  167.             // begin [file="/xuanxiuke1.jsp";from=(54,37);to=(54,57)]
  168.                 out.print(ts.getString("skjs"));
  169.             // end
  170.             // HTML // begin [file="/xuanxiuke1.jsp";from=(54,59);to=(56,13)]
  171.                 out.write("</td>rn             </tr>rn             ");
  172.             // end
  173.             // begin [file="/xuanxiuke1.jsp";from=(56,15);to=(56,17)]
  174.                 } 
  175.             // end
  176.             // HTML // begin [file="/xuanxiuke1.jsp";from=(56,19);to=(58,11)]
  177.                 out.write("rn           </table>rn           ");
  178.             // end
  179.             // begin [file="/xuanxiuke1.jsp";from=(58,13);to=(59,12)]
  180.                 }else
  181.                            {
  182.             // end
  183.             // HTML // begin [file="/xuanxiuke1.jsp";from=(59,14);to=(65,11)]
  184.                 out.write("rn           <script language="javascript">rn           alert("该学生没有选课");rn           history.go(-1);rn           history.go(0);rn           </script>rn           ");
  185.             // end
  186.             // begin [file="/xuanxiuke1.jsp";from=(65,13);to=(67,12)]
  187.                 }
  188.                            }else
  189.                            {
  190.             // end
  191.             // HTML // begin [file="/xuanxiuke1.jsp";from=(67,14);to=(73,11)]
  192.                 out.write("rn           <script language="javascript">rn           alert("该学生没有选课");rn           history.go(-1);rn           history.go(0);rn           </script>rn           ");
  193.             // end
  194.             // begin [file="/xuanxiuke1.jsp";from=(73,13);to=(76,6)]
  195.                 }
  196.                            }
  197.                    else
  198.                      {
  199.             // end
  200.             // HTML // begin [file="/xuanxiuke1.jsp";from=(76,8);to=(82,3)]
  201.                 out.write("rn     <script language="javascript">rn     alert("没有你输入的学生,请重新输入");rn     history.go(-1);rn     history.go(0);rn     </script>rn   ");
  202.             // end
  203.             // begin [file="/xuanxiuke1.jsp";from=(82,5);to=(83,6)]
  204.                 }
  205.                       
  206.             // end
  207.             // HTML // begin [file="/xuanxiuke1.jsp";from=(83,8);to=(91,0)]
  208.                 out.write("rn<br><br><br>rnrn <a href="xuanxiuke.jsp">返回</a>rnrn</body>rnrnrn");
  209.             // end
  210.         } catch (Throwable t) {
  211.             if (out != null && out.getBufferSize() != 0)
  212.                 out.clearBuffer();
  213.             if (pageContext != null) pageContext.handlePageException(t);
  214.         } finally {
  215.             if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
  216.         }
  217.     }
  218. }