update_stu.jsp~6~
资源名称:JSP02.rar [点击查看]
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:3k
源码类别:
Jsp/Servlet
开发平台:
VBScript
- <%@ page contentType="text/html; charset=GBK" %>
- <%@ page import="java.sql.*" %>
- <%@ page language="java" %>
- <%@ page import = "proj112.ISOtoGb2312"%>
- <HTML>
- <HEAD>
- <TITLE>update_form</TITLE>
- </HEAD>
- <body text="#808080" link="#FF99CC" vlink="#FF8080" alink="#FF99CC" topmargin="0" leftmargin="0"><style>
- <!--
- 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; }
- -->
- </style>
- <table width="90%" align="center">
- <tr>
- <td height="10"></td>
- </tr>
- <tr>
- <td align="center"><font color="green" size="5">请修改你的信息</font></td>
- </tr>
- <tr>
- <td height="10"></td>
- </tr>
- <tr>
- <td align="center"></td>
- </tr>
- <tr>
- <td height="10"></td>
- </tr>
- </table>
- <CENTER>
- <%
- 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")) +"'"); //执行SQL语句
- %>
- <TABLE width="80%" border="1" bordercolor="#CC9966">
- <%
- //利用while循环将数据表中的记录列出
- while (rs.next())
- {
- %>
- <form method="post" action="update_stumessage.jsp" name="form1">
- <tr>
- <td height="20"> 学 号:</td><td><input type="text" name="stu_id" size="20" value="<%=rs.getString(1)%>"></td>
- </tr>
- <tr>
- <td height="20"> 姓 名:</td><td><input type="text" name="name" size="20" value="<%=rs.getString(2)%>"></td>
- </tr>
- <tr>
- <td height="20"> 性 别:</td><td><input type="text" name="sex" size="20" value="<%=rs.getString(3)%>"></td>
- </tr>
- <tr>
- <td height="20"> 年 龄:</td><td><input type="text" name="age" size="20" value="<%=rs.getString(4)%>"></td>
- </tr>
- <tr>
- <td height="20"> 专 业:</td><td><input type="text" name="dept" size="20" value="<%=rs.getString(5)%>"></td>
- </tr>
- <tr>
- <td height="20"> 入学时间:</td><td><input type="text" name="ruxdate" size="20" value="<%=rs.getString(6)%>"></td>
- </tr>
- <tr>
- <td height="20"> 联系方式:</td><td><input type="text" name="tel" size="40" value="<%=rs.getString(7) %>"></td>
- </tr>
- <tr>
- <td height="20"> 住 址:</td><td><input type="text" name="address" size="20" value="<%=rs.getString(8)%>"></td>
- </tr>
- <tr>
- <td></td><td><input type="submit" value="确定" onclick="return a()">
- </td>
- </tr>
- <tr><td height="10"></td></tr>
- </form>
- <%
- }
- rs.close(); //关闭ResultSet对象
- stmt.close(); //关闭Statement对象
- con.close(); //关闭Connection对象
- %>
- </table>
- </CENTER>
- </BODY>
- </HTML>