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

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 login1_0002ejsp_jsp extends HttpJspBase {
  8.     static {
  9.     }
  10.     public login1_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="/login1.jsp";from=(0,48);to=(1,0)]
  43.                 out.write("rn");
  44.             // end
  45.             // HTML // begin [file="/login1.jsp";from=(1,31);to=(2,0)]
  46.                 out.write("rn");
  47.             // end
  48.             // HTML // begin [file="/login1.jsp";from=(2,27);to=(3,0)]
  49.                 out.write("rn");
  50.             // end
  51.             // HTML // begin [file="/login1.jsp";from=(3,41);to=(34,0)]
  52.                 out.write("rnrn<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>rnrnrn<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>rn<CENTER>rn");
  53.             // end
  54.             // begin [file="/login1.jsp";from=(34,2);to=(41,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.                 
  62.             // end
  63.             // HTML // begin [file="/login1.jsp";from=(41,2);to=(43,1)]
  64.                 out.write("rn<TABLE  height="350" width="80%" border="1" bordercolor="#CC9966">rnt");
  65.             // end
  66.             // begin [file="/login1.jsp";from=(43,3);to=(47,2)]
  67.                 
  68.                  //利用while循环将数据表中的记录列出
  69.                  while (rs.next())
  70.                  {
  71.                 
  72.             // end
  73.             // HTML // begin [file="/login1.jsp";from=(47,4);to=(51,100)]
  74.                 out.write("rnrn           <tr><td height="10"></td></tr>rn            <tr>rnt         <td>&nbsp;&nbsp;&nbsp;&nbsp;学号:</td><td><input type="text" name="stu_id" size="20" value="");
  75.             // end
  76.             // begin [file="/login1.jsp";from=(51,103);to=(51,118)]
  77.                 out.print(rs.getString(1));
  78.             // end
  79.             // HTML // begin [file="/login1.jsp";from=(51,120);to=(54,98)]
  80.                 out.write(""></td>rnt   </tr>rnt  <tr>rnt         <td>&nbsp;&nbsp;&nbsp;&nbsp;姓名:</td><td><input type="text" name="name" size="20" value="");
  81.             // end
  82.             // begin [file="/login1.jsp";from=(54,101);to=(54,116)]
  83.                 out.print(rs.getString(2));
  84.             // end
  85.             // HTML // begin [file="/login1.jsp";from=(54,118);to=(57,98)]
  86.                 out.write(""></td>rnt   </tr>rnt   <tr>rnt         <td>&nbsp;&nbsp;&nbsp;&nbsp;性别:</td><td><input type="text" name="sex"  size="10" value="");
  87.             // end
  88.             // begin [file="/login1.jsp";from=(57,101);to=(57,117)]
  89.                 out.print(rs.getString(3) );
  90.             // end
  91.             // HTML // begin [file="/login1.jsp";from=(57,119);to=(60,99)]
  92.                 out.write(""></td>rnt   </tr>rnt   <tr>rnt         <td>&nbsp;&nbsp;&nbsp;&nbsp;出生年月:</td><td><input type="text" name="age" size="10" value="");
  93.             // end
  94.             // begin [file="/login1.jsp";from=(60,102);to=(60,117)]
  95.                 out.print(rs.getString(4));
  96.             // end
  97.             // HTML // begin [file="/login1.jsp";from=(60,119);to=(63,100)]
  98.                 out.write(""></td>rnt   </tr>rnt   <tr>rnt         <td>&nbsp;&nbsp;&nbsp;&nbsp;所学专业:</td><td><input type="text" name="dept" size="20" value="");
  99.             // end
  100.             // begin [file="/login1.jsp";from=(63,103);to=(63,118)]
  101.                 out.print(rs.getString(5));
  102.             // end
  103.             // HTML // begin [file="/login1.jsp";from=(63,120);to=(66,103)]
  104.                 out.write(""></td>rnt   </tr>rnt   <tr>rnt         <td>&nbsp;&nbsp;&nbsp;&nbsp;入学时间:</td><td><input type="text" name="ruxdate" size="40" value="");
  105.             // end
  106.             // begin [file="/login1.jsp";from=(66,106);to=(66,122)]
  107.                 out.print(rs.getString(6) );
  108.             // end
  109.             // HTML // begin [file="/login1.jsp";from=(66,124);to=(69,99)]
  110.                 out.write(""></td>rnt   </tr>rn           <tr>rnt         <td>&nbsp;&nbsp;&nbsp;&nbsp;联系方式:</td><td><input type="text" name="tel" size="40" value="");
  111.             // end
  112.             // begin [file="/login1.jsp";from=(69,102);to=(69,118)]
  113.                 out.print(rs.getString(7) );
  114.             // end
  115.             // HTML // begin [file="/login1.jsp";from=(69,120);to=(72,101)]
  116.                 out.write(""></td>rnt   </tr>rnt   <tr>rnt         <td>&nbsp;&nbsp;&nbsp;&nbsp;住址:</td><td><input type="text" name="address" size="40" value="");
  117.             // end
  118.             // begin [file="/login1.jsp";from=(72,104);to=(72,120)]
  119.                 out.print(rs.getString(8) );
  120.             // end
  121.             // HTML // begin [file="/login1.jsp";from=(72,122);to=(79,2)]
  122.                 out.write(""></td>rnt   </tr>rnrn           <tr><td height="10"></td></tr>rnrn           <tr><td height="10"></td></tr>rnrntt");
  123.             // end
  124.             // begin [file="/login1.jsp";from=(79,4);to=(84,1)]
  125.                 
  126.                  }
  127.                  rs.close(); //关闭ResultSet对象
  128.                  stmt.close(); //关闭Statement对象
  129.                  con.close();  //关闭Connection对象
  130.                 
  131.             // end
  132.             // HTML // begin [file="/login1.jsp";from=(84,3);to=(90,0)]
  133.                 out.write("rn</table>rnrn</CENTER>rn</BODY>rn</HTML>rn");
  134.             // end
  135.         } catch (Throwable t) {
  136.             if (out != null && out.getBufferSize() != 0)
  137.                 out.clearBuffer();
  138.             if (pageContext != null) pageContext.handlePageException(t);
  139.         } finally {
  140.             if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
  141.         }
  142.     }
  143. }