login1_0002ejsp_jsp.java
资源名称:JSP02.rar [点击查看]
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:8k
源码类别:
Jsp/Servlet
开发平台:
VBScript
- import java.sql.*;
- import proj112.ISOtoGb2312;
- import javax.servlet.*;
- import javax.servlet.http.*;
- import javax.servlet.jsp.*;
- import org.apache.jasper.runtime.*;
- public class login1_0002ejsp_jsp extends HttpJspBase {
- static {
- }
- public login1_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="/login1.jsp";from=(0,48);to=(1,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/login1.jsp";from=(1,31);to=(2,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/login1.jsp";from=(2,27);to=(3,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/login1.jsp";from=(3,41);to=(34,0)]
- 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");
- // end
- // begin [file="/login1.jsp";from=(34,2);to=(41,0)]
- Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //载入驱动程序类别
- Connection con = DriverManager.getConnection("jdbc:odbc:dsn112"); //建立数据库链接
- Statement stmt = con.createStatement(); //建立Statement对象
- ResultSet rs; //建立ResultSet(结果集)对象
- 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语句
- // end
- // HTML // begin [file="/login1.jsp";from=(41,2);to=(43,1)]
- out.write("rn<TABLE height="350" width="80%" border="1" bordercolor="#CC9966">rnt");
- // end
- // begin [file="/login1.jsp";from=(43,3);to=(47,2)]
- //利用while循环将数据表中的记录列出
- while (rs.next())
- {
- // end
- // HTML // begin [file="/login1.jsp";from=(47,4);to=(51,100)]
- out.write("rnrn <tr><td height="10"></td></tr>rn <tr>rnt <td> 学号:</td><td><input type="text" name="stu_id" size="20" value="");
- // end
- // begin [file="/login1.jsp";from=(51,103);to=(51,118)]
- out.print(rs.getString(1));
- // end
- // HTML // begin [file="/login1.jsp";from=(51,120);to=(54,98)]
- out.write(""></td>rnt </tr>rnt <tr>rnt <td> 姓名:</td><td><input type="text" name="name" size="20" value="");
- // end
- // begin [file="/login1.jsp";from=(54,101);to=(54,116)]
- out.print(rs.getString(2));
- // end
- // HTML // begin [file="/login1.jsp";from=(54,118);to=(57,98)]
- out.write(""></td>rnt </tr>rnt <tr>rnt <td> 性别:</td><td><input type="text" name="sex" size="10" value="");
- // end
- // begin [file="/login1.jsp";from=(57,101);to=(57,117)]
- out.print(rs.getString(3) );
- // end
- // HTML // begin [file="/login1.jsp";from=(57,119);to=(60,99)]
- out.write(""></td>rnt </tr>rnt <tr>rnt <td> 出生年月:</td><td><input type="text" name="age" size="10" value="");
- // end
- // begin [file="/login1.jsp";from=(60,102);to=(60,117)]
- out.print(rs.getString(4));
- // end
- // HTML // begin [file="/login1.jsp";from=(60,119);to=(63,100)]
- out.write(""></td>rnt </tr>rnt <tr>rnt <td> 所学专业:</td><td><input type="text" name="dept" size="20" value="");
- // end
- // begin [file="/login1.jsp";from=(63,103);to=(63,118)]
- out.print(rs.getString(5));
- // end
- // HTML // begin [file="/login1.jsp";from=(63,120);to=(66,103)]
- out.write(""></td>rnt </tr>rnt <tr>rnt <td> 入学时间:</td><td><input type="text" name="ruxdate" size="40" value="");
- // end
- // begin [file="/login1.jsp";from=(66,106);to=(66,122)]
- out.print(rs.getString(6) );
- // end
- // HTML // begin [file="/login1.jsp";from=(66,124);to=(69,99)]
- out.write(""></td>rnt </tr>rn <tr>rnt <td> 联系方式:</td><td><input type="text" name="tel" size="40" value="");
- // end
- // begin [file="/login1.jsp";from=(69,102);to=(69,118)]
- out.print(rs.getString(7) );
- // end
- // HTML // begin [file="/login1.jsp";from=(69,120);to=(72,101)]
- out.write(""></td>rnt </tr>rnt <tr>rnt <td> 住址:</td><td><input type="text" name="address" size="40" value="");
- // end
- // begin [file="/login1.jsp";from=(72,104);to=(72,120)]
- out.print(rs.getString(8) );
- // end
- // HTML // begin [file="/login1.jsp";from=(72,122);to=(79,2)]
- out.write(""></td>rnt </tr>rnrn <tr><td height="10"></td></tr>rnrn <tr><td height="10"></td></tr>rnrntt");
- // end
- // begin [file="/login1.jsp";from=(79,4);to=(84,1)]
- }
- rs.close(); //关闭ResultSet对象
- stmt.close(); //关闭Statement对象
- con.close(); //关闭Connection对象
- // end
- // HTML // begin [file="/login1.jsp";from=(84,3);to=(90,0)]
- out.write("rn</table>rnrn</CENTER>rn</BODY>rn</HTML>rn");
- // 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);
- }
- }
- }