chakan1_0002ejsp_jsp.java
资源名称:JSP02.rar [点击查看]
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:12k
源码类别:
Jsp/Servlet
开发平台:
VBScript
- import java.sql.*;
- import java.util.*;
- import proj112.*;
- import javax.servlet.*;
- import javax.servlet.http.*;
- import javax.servlet.jsp.*;
- import org.apache.jasper.runtime.*;
- public class chakan1_0002ejsp_jsp extends HttpJspBase {
- // begin [file="/chakan1.jsp";from=(5,0);to=(5,57)]
- // end
- static {
- }
- public chakan1_0002ejsp_jsp( ) {
- }
- private static boolean _jspx_inited = false;
- public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
- }
- 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;
- String _value = null;
- try {
- if (_jspx_inited == false) {
- synchronized (this) {
- if (_jspx_inited == false) {
- _jspx_init();
- _jspx_inited = true;
- }
- }
- }
- _jspxFactory = JspFactory.getDefaultFactory();
- response.setContentType("text/html; charset=GBK");
- pageContext = _jspxFactory.getPageContext(this, request, response,
- "", true, 8192, true);
- application = pageContext.getServletContext();
- config = pageContext.getServletConfig();
- session = pageContext.getSession();
- out = pageContext.getOut();
- // HTML // begin [file="/chakan1.jsp";from=(0,48);to=(1,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/chakan1.jsp";from=(1,31);to=(2,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/chakan1.jsp";from=(2,27);to=(3,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/chakan1.jsp";from=(3,32);to=(4,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/chakan1.jsp";from=(4,30);to=(5,0)]
- out.write("rn");
- // end
- // begin [file="/chakan1.jsp";from=(5,0);to=(5,57)]
- proj112.dbconn a = null;
- boolean _jspx_speciala = false;
- synchronized (pageContext) {
- a= (proj112.dbconn)
- pageContext.getAttribute("a",PageContext.PAGE_SCOPE);
- if ( a == null ) {
- _jspx_speciala = true;
- try {
- a = (proj112.dbconn) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "proj112.dbconn");
- } catch (ClassNotFoundException exc) {
- throw new InstantiationException(exc.getMessage());
- } catch (Exception exc) {
- throw new ServletException (" Cannot create bean of class "+"proj112.dbconn", exc);
- }
- pageContext.setAttribute("a", a, PageContext.PAGE_SCOPE);
- }
- }
- if(_jspx_speciala == true) {
- // end
- // begin [file="/chakan1.jsp";from=(5,0);to=(5,57)]
- }
- // end
- // HTML // begin [file="/chakan1.jsp";from=(5,57);to=(14,3)]
- out.write("rn<html>rn<head>rn<title>rnxuanke_1rn</title>rn</head>rn<body bgcolor="#ffffff">rnrn ");
- // end
- // begin [file="/chakan1.jsp";from=(14,5);to=(25,5)]
- String stu_id=request.getParameter("stu_id");
- int totalrecord = 0;
- String sql="";
- String sql1="";
- String sql2="";
- String name="";
- sql="SELECT * FROM student where stu_id='"+stu_id+"'";
- ResultSet rs=a.executeQuery(sql);
- if(rs.next())
- {
- name=rs.getString("stu_name");
- // end
- // HTML // begin [file="/chakan1.jsp";from=(25,7);to=(26,31)]
- out.write("rn <br> 学号:<font color="red">");
- // end
- // begin [file="/chakan1.jsp";from=(26,34);to=(26,41)]
- out.print(stu_id );
- // end
- // HTML // begin [file="/chakan1.jsp";from=(26,43);to=(26,84)]
- out.write("</font> 姓名:<font color="red">");
- // end
- // begin [file="/chakan1.jsp";from=(26,87);to=(26,92)]
- out.print(name );
- // end
- // HTML // begin [file="/chakan1.jsp";from=(26,94);to=(27,5)]
- out.write("</font>,所学基本课程成绩如下:<br><br><hr><br><br>rn ");
- // end
- // begin [file="/chakan1.jsp";from=(27,7);to=(36,9)]
- sql1 = "SELECT count(*) as recordcount FROM 成绩关联 where stu_id='"+stu_id+"'";
- ResultSet bs = a.executeQuery(sql1);
- session.setAttribute("stu_id",stu_id);
- if (bs.next())
- {
- totalrecord = bs.getInt("recordcount");
- if(totalrecord!=0){
- sql2="SELECT * FROM chengji,成绩关联 where chengji.kch=成绩关联.课程号 and 成绩关联.stu_id='"+stu_id+"'";
- ResultSet ts=a.executeQuery(sql2);
- // end
- // HTML // begin [file="/chakan1.jsp";from=(36,11);to=(49,13)]
- 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 ");
- // end
- // begin [file="/chakan1.jsp";from=(49,15);to=(50,30)]
- while(ts.next()){
- // end
- // HTML // begin [file="/chakan1.jsp";from=(50,32);to=(52,34)]
- out.write("rn <tr>rn <td align="center">");
- // end
- // begin [file="/chakan1.jsp";from=(52,37);to=(52,52)]
- out.print(ts.getString(1));
- // end
- // HTML // begin [file="/chakan1.jsp";from=(52,54);to=(52,59)]
- out.write("</td>");
- // end
- // begin [file="/chakan1.jsp";from=(52,61);to=(52,96)]
- String kechenghao=ts.getString(2);
- // end
- // HTML // begin [file="/chakan1.jsp";from=(52,98);to=(53,34)]
- out.write("rn <td align="center">");
- // end
- // begin [file="/chakan1.jsp";from=(53,37);to=(53,52)]
- out.print(ts.getString(2));
- // end
- // HTML // begin [file="/chakan1.jsp";from=(53,54);to=(54,34)]
- out.write("</td>rn <td align="center">");
- // end
- // begin [file="/chakan1.jsp";from=(54,37);to=(54,52)]
- out.print(ts.getString(3));
- // end
- // HTML // begin [file="/chakan1.jsp";from=(54,54);to=(55,34)]
- out.write("</td>rn <td align="center">");
- // end
- // begin [file="/chakan1.jsp";from=(55,37);to=(55,52)]
- out.print(ts.getString(4));
- // end
- // HTML // begin [file="/chakan1.jsp";from=(55,54);to=(56,34)]
- out.write("</td>rn <td align="center">");
- // end
- // begin [file="/chakan1.jsp";from=(56,37);to=(56,52)]
- out.print(ts.getString(5));
- // end
- // HTML // begin [file="/chakan1.jsp";from=(56,54);to=(57,34)]
- out.write("</td>rn <td align="center">");
- // end
- // begin [file="/chakan1.jsp";from=(57,37);to=(57,52)]
- out.print(ts.getString(9));
- // end
- // HTML // begin [file="/chakan1.jsp";from=(57,54);to=(58,34)]
- out.write("</td>rn <td align="center">");
- // end
- // begin [file="/chakan1.jsp";from=(58,37);to=(58,53)]
- out.print(ts.getString(10));
- // end
- // HTML // begin [file="/chakan1.jsp";from=(58,55);to=(59,59)]
- out.write("</td>rn <td align="center"><a href="chakan11.jsp?id=");
- // end
- // begin [file="/chakan1.jsp";from=(59,62);to=(59,72)]
- out.print(kechenghao);
- // end
- // HTML // begin [file="/chakan1.jsp";from=(59,74);to=(61,13)]
- out.write("">修改</a></td>rn </tr>rn ");
- // end
- // begin [file="/chakan1.jsp";from=(61,15);to=(61,17)]
- }
- // end
- // HTML // begin [file="/chakan1.jsp";from=(61,19);to=(64,11)]
- out.write("rn </table>rnrn ");
- // end
- // begin [file="/chakan1.jsp";from=(64,13);to=(65,12)]
- }else
- {
- // end
- // HTML // begin [file="/chakan1.jsp";from=(65,14);to=(71,11)]
- out.write("rn <script language="javascript">rn alert("该学生没有成绩记录");rn history.go(-1);rn history.go(0);rn </script>rn ");
- // end
- // begin [file="/chakan1.jsp";from=(71,13);to=(73,12)]
- }
- }else
- {
- // end
- // HTML // begin [file="/chakan1.jsp";from=(73,14);to=(79,11)]
- out.write("rn <script language="javascript">rn alert("该学生没有成绩记录");rn history.go(-1);rn history.go(0);rn </script>rn ");
- // end
- // begin [file="/chakan1.jsp";from=(79,13);to=(82,6)]
- }
- }
- else
- {
- // end
- // HTML // begin [file="/chakan1.jsp";from=(82,8);to=(88,3)]
- out.write("rn <script language="javascript">rn alert("没有你输入的学生,请重新输入");rn history.go(-1);rn history.go(0);rn </script>rn ");
- // end
- // begin [file="/chakan1.jsp";from=(88,5);to=(89,6)]
- }
- // end
- // HTML // begin [file="/chakan1.jsp";from=(89,8);to=(96,0)]
- out.write("rn<br><br><br><br>rn <a href="chakan.jsp">返回</a>rnrn</body>rnrnrn");
- // end
- } catch (Throwable t) {
- if (out != null && out.getBufferSize() != 0)
- out.clearBuffer();
- if (pageContext != null) pageContext.handlePageException(t);
- } finally {
- if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
- }
- }
- }