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

Jsp/Servlet

开发平台:

VBScript

  1. <%@ page contentType="text/html; charset=GBK" %>
  2. <%@ page import="java.sql.*" %>
  3. <%@ page language="java" %>
  4. <%@ page import = "proj112.ISOtoGb2312"%>
  5. <HTML>
  6. <HEAD>
  7. <TITLE>update_form</TITLE>
  8. </HEAD>
  9. <body text="#808080" link="#FF99CC" vlink="#FF8080" alink="#FF99CC" topmargin="0" leftmargin="0"><style>
  10. <!--
  11. BODY {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; }
  12. -->
  13. </style>
  14. <table width="90%" align="center">
  15.    <tr>
  16.     <td height="10"></td>
  17.   </tr>
  18.   <tr>
  19.     <td align="center"><font color="green" size="5">请修改你的信息</font></td>
  20.   </tr>
  21.    <tr>
  22.     <td height="10"></td>
  23.   </tr>
  24.   <tr>
  25.     <td align="center"></td>
  26.   </tr>
  27.    <tr>
  28.     <td height="10"></td>
  29.   </tr>
  30. </table>
  31. <CENTER>
  32. <%
  33. Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //载入驱动程序类别
  34. Connection con = DriverManager.getConnection("jdbc:odbc:dsn112"); //建立数据库链接
  35. Statement stmt = con.createStatement(); //建立Statement对象
  36. ResultSet rs; //建立ResultSet(结果集)对象
  37. rs = stmt.executeQuery("SELECT * FROM Info WHERE stu_id='"+ISOtoGb2312.convert( request.getParameter("stu_id")) +"'"); //执行SQL语句
  38. %>
  39. <TABLE   width="80%" border="1" bordercolor="#CC9966">
  40. <%
  41. //利用while循环将数据表中的记录列出
  42. while (rs.next())
  43. {
  44. %>
  45.                 <form method="post" action="update_message.jsp" name="form1">
  46.   <tr>
  47.          <td height="20">&nbsp;&nbsp;&nbsp;&nbsp;学  号:</td><td><input type="text" name="stu_id" size="20" value="<%=rs.getString(1)%>"></td>
  48.    </tr>
  49.           <tr>
  50.          <td height="20">&nbsp;&nbsp;&nbsp;&nbsp;学  号:</td><td><input type="text" name="stu_id" size="20" value="<%=rs.getString(1)%>"></td>
  51.    </tr>
  52.            <tr>
  53.          <td height="20">&nbsp;&nbsp;&nbsp;&nbsp;学  号:</td><td><input type="text" name="stu_id" size="20" value="<%=rs.getString(1)%>"></td>
  54.    </tr>
  55.            <tr>
  56.          <td height="20">&nbsp;&nbsp;&nbsp;&nbsp;学  号:</td><td><input type="text" name="stu_id" size="20" value="<%=rs.getString(1)%>"></td>
  57.    </tr>
  58.            <tr>
  59.          <td height="20">&nbsp;&nbsp;&nbsp;&nbsp;学  号:</td><td><input type="text" name="stu_id" size="20" value="<%=rs.getString(1)%>"></td>
  60.    </tr>
  61.           <tr>
  62.          <td height="20">&nbsp;&nbsp;&nbsp;&nbsp;密  码:</td><td><input type="text" name="stu_password" size="40" value="<%=rs.getString(9) %>"></td>
  63.    </tr>
  64.    <tr>
  65.          <td></td><td><input type="submit" value="确定" onclick="return a()">&nbsp;&nbsp;&nbsp;&nbsp;
  66.              </td>
  67.    </tr>
  68.            <tr><td height="10"></td></tr>
  69. </form>
  70. <%
  71. }
  72. rs.close(); //关闭ResultSet对象
  73. stmt.close(); //关闭Statement对象
  74. con.close();  //关闭Connection对象
  75. %>
  76. </table>
  77. </CENTER>
  78. </BODY>
  79. </HTML>