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

Jsp/Servlet

开发平台:

VBScript

  1. import java.sql.*;
  2. import proj112.ISOtoGb2312;
  3. import javax.servlet.*;
  4. import javax.servlet.http.*;
  5. import javax.servlet.jsp.*;
  6. import org.apache.jasper.runtime.*;
  7. public class update_0005fstu_0002ejsp_jsp extends HttpJspBase {
  8.     static {
  9.     }
  10.     public update_0005fstu_0002ejsp_jsp( ) {
  11.     }
  12.     private static boolean _jspx_inited = false;
  13.     public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
  14.     }
  15.     public void _jspService(HttpServletRequest request, HttpServletResponse  response)
  16.         throws java.io.IOException, ServletException {
  17.         JspFactory _jspxFactory = null;
  18.         PageContext pageContext = null;
  19.         HttpSession session = null;
  20.         ServletContext application = null;
  21.         ServletConfig config = null;
  22.         JspWriter out = null;
  23.         Object page = this;
  24.         String  _value = null;
  25.         try {
  26.             if (_jspx_inited == false) {
  27.                 synchronized (this) {
  28.                     if (_jspx_inited == false) {
  29.                         _jspx_init();
  30.                         _jspx_inited = true;
  31.                     }
  32.                 }
  33.             }
  34.             _jspxFactory = JspFactory.getDefaultFactory();
  35.             response.setContentType("text/html; charset=GBK");
  36.             pageContext = _jspxFactory.getPageContext(this, request, response,
  37.              "", true, 8192, true);
  38.             application = pageContext.getServletContext();
  39.             config = pageContext.getServletConfig();
  40.             session = pageContext.getSession();
  41.             out = pageContext.getOut();
  42.             // HTML // begin [file="/update_stu.jsp";from=(0,48);to=(1,0)]
  43.                 out.write("rn");
  44.             // end
  45.             // HTML // begin [file="/update_stu.jsp";from=(1,31);to=(2,0)]
  46.                 out.write("rn");
  47.             // end
  48.             // HTML // begin [file="/update_stu.jsp";from=(2,27);to=(3,0)]
  49.                 out.write("rn");
  50.             // end
  51.             // HTML // begin [file="/update_stu.jsp";from=(3,41);to=(33,0)]
  52.                 out.write("rn<HTML>rn<HEAD>rn<TITLE>update_form</TITLE>rn</HEAD>rn<body text="#808080" link="#FF99CC" vlink="#FF8080" alink="#FF99CC" topmargin="0" leftmargin="0"><style>rn<!--rnBODY {SCROLLBAR-FACE-COLOR: #FFFFFF; SCROLLBAR-HIGHLIGHT-COLOR: #FFFFFF; SCROLLBAR-SHADOW-COLOR: #FFFFFF; SCROLLBAR-3DLIGHT-COLOR: #FFFFFF; SCROLLBAR-ARROW-COLOR:  #FFAAAA; SCROLLBAR-TRACK-COLOR: #FFFFFF; SCROLLBAR-DARKSHADOW-COLOR: #FFFFFF; }rn-->rn</style>rn<table width="90%" align="center">rn   <tr>rn    <td height="10"></td>rn  </tr>rn  <tr>rn    <td align="center"><font color="green" size="5">请修改你的信息</font></td>rn  </tr>rn   <tr>rn    <td height="10"></td>rn  </tr>rn  <tr>rn    <td align="center"></td>rn  </tr>rn   <tr>rn    <td height="10"></td>rn  </tr>rn</table>rnrnrn<CENTER>rn");
  53.             // end
  54.             // begin [file="/update_stu.jsp";from=(33,2);to=(39,0)]
  55.                 
  56.                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //载入驱动程序类别
  57.                 Connection con = DriverManager.getConnection("jdbc:odbc:dsn112"); //建立数据库链接
  58.                 Statement stmt = con.createStatement(); //建立Statement对象
  59.                 ResultSet rs; //建立ResultSet(结果集)对象
  60.                 rs = stmt.executeQuery("SELECT * FROM Info WHERE stu_id='"+ISOtoGb2312.convert( request.getParameter("stu_id")) +"' and stu_password='"+ISOtoGb2312.convert( request.getParameter("stu_password")) +"'"); //执行SQL语句
  61.             // end
  62.             // HTML // begin [file="/update_stu.jsp";from=(39,2);to=(41,1)]
  63.                 out.write("rn<TABLE   width="80%" border="1" bordercolor="#CC9966">rnt");
  64.             // end
  65.             // begin [file="/update_stu.jsp";from=(41,3);to=(45,2)]
  66.                 
  67.                  //利用while循环将数据表中的记录列出
  68.                  while (rs.next())
  69.                  {
  70.                 
  71.             // end
  72.             // HTML // begin [file="/update_stu.jsp";from=(45,4);to=(50,114)]
  73.                 out.write("rn                <form method="post" action="update_stumessage.jsp" name="form1">rnrnrnt  <tr>rnt         <td height="20">&nbsp;&nbsp;&nbsp;&nbsp;学  号:</td><td><input type="text" name="stu_id" size="20" value="");
  74.             // end
  75.             // begin [file="/update_stu.jsp";from=(50,117);to=(50,132)]
  76.                 out.print(rs.getString(1));
  77.             // end
  78.             // HTML // begin [file="/update_stu.jsp";from=(50,134);to=(53,112)]
  79.                 out.write(""></td>rnt   </tr>rn          <tr>rnt         <td height="20">&nbsp;&nbsp;&nbsp;&nbsp;姓  名:</td><td><input type="text" name="name" size="20" value="");
  80.             // end
  81.             // begin [file="/update_stu.jsp";from=(53,115);to=(53,130)]
  82.                 out.print(rs.getString(2));
  83.             // end
  84.             // HTML // begin [file="/update_stu.jsp";from=(53,132);to=(56,111)]
  85.                 out.write(""></td>rnt   </tr>rn           <tr>rnt         <td height="20">&nbsp;&nbsp;&nbsp;&nbsp;性  别:</td><td><input type="text" name="sex" size="20" value="");
  86.             // end
  87.             // begin [file="/update_stu.jsp";from=(56,114);to=(56,129)]
  88.                 out.print(rs.getString(3));
  89.             // end
  90.             // HTML // begin [file="/update_stu.jsp";from=(56,131);to=(59,111)]
  91.                 out.write(""></td>rnt   </tr>rn           <tr>rnt         <td height="20">&nbsp;&nbsp;&nbsp;&nbsp;年  龄:</td><td><input type="text" name="age" size="20" value="");
  92.             // end
  93.             // begin [file="/update_stu.jsp";from=(59,114);to=(59,129)]
  94.                 out.print(rs.getString(4));
  95.             // end
  96.             // HTML // begin [file="/update_stu.jsp";from=(59,131);to=(62,112)]
  97.                 out.write(""></td>rnt   </tr>rn           <tr>rnt         <td height="20">&nbsp;&nbsp;&nbsp;&nbsp;专  业:</td><td><input type="text" name="dept" size="20" value="");
  98.             // end
  99.             // begin [file="/update_stu.jsp";from=(62,115);to=(62,130)]
  100.                 out.print(rs.getString(5));
  101.             // end
  102.             // HTML // begin [file="/update_stu.jsp";from=(62,132);to=(65,115)]
  103.                 out.write(""></td>rnt   </tr>rn           <tr>rnt         <td height="20">&nbsp;&nbsp;&nbsp;&nbsp;入学时间:</td><td><input type="text" name="ruxdate" size="20" value="");
  104.             // end
  105.             // begin [file="/update_stu.jsp";from=(65,118);to=(65,133)]
  106.                 out.print(rs.getString(6));
  107.             // end
  108.             // HTML // begin [file="/update_stu.jsp";from=(65,135);to=(68,111)]
  109.                 out.write(""></td>rnt   </tr>rn      t   <tr>rnt         <td height="20">&nbsp;&nbsp;&nbsp;&nbsp;联系方式:</td><td><input type="text" name="tel" size="40" value="");
  110.             // end
  111.             // begin [file="/update_stu.jsp";from=(68,114);to=(68,130)]
  112.                 out.print(rs.getString(7) );
  113.             // end
  114.             // HTML // begin [file="/update_stu.jsp";from=(68,132);to=(71,115)]
  115.                 out.write(""></td>rnt   </tr>rn           <tr>rnt         <td height="20">&nbsp;&nbsp;&nbsp;&nbsp;住  址:</td><td><input type="text" name="address" size="20" value="");
  116.             // end
  117.             // begin [file="/update_stu.jsp";from=(71,118);to=(71,133)]
  118.                 out.print(rs.getString(8));
  119.             // end
  120.             // HTML // begin [file="/update_stu.jsp";from=(71,135);to=(80,2)]
  121.                 out.write(""></td>rnt   </tr>rnrnt   <tr>rnt         <td></td><td><input type="submit" value="确定" onclick="return a()">&nbsp;&nbsp;&nbsp;&nbsp;rntt             </td>rnt   </tr>rn           <tr><td height="10"></td></tr>rn</form>rntt");
  122.             // end
  123.             // begin [file="/update_stu.jsp";from=(80,4);to=(85,1)]
  124.                 
  125.                  }
  126.                  rs.close(); //关闭ResultSet对象
  127.                  stmt.close(); //关闭Statement对象
  128.                  con.close();  //关闭Connection对象
  129.                 
  130.             // end
  131.             // HTML // begin [file="/update_stu.jsp";from=(85,3);to=(91,0)]
  132.                 out.write("rn</table>rnrn</CENTER>rn</BODY>rn</HTML>rn");
  133.             // end
  134.         } catch (Throwable t) {
  135.             if (out != null && out.getBufferSize() != 0)
  136.                 out.clearBuffer();
  137.             if (pageContext != null) pageContext.handlePageException(t);
  138.         } finally {
  139.             if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
  140.         }
  141.     }
  142. }