update.jsp~18~
资源名称:JSP02.rar [点击查看]
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:3k
源码类别:
Jsp/Servlet
开发平台:
VBScript
- <%@ page contentType="text/html; charset=GB2312" %>
- <%@ page import = "java.sql.*"%>
- <%@ page language = "java"%>
- <%@ page import = "proj112.ISOtoGb2312"%>
- <HTML>
- <HEAD>
- <TITLE>update</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>
- <%
- String stu_id=ISOtoGb2312.convert(request.getParameter("stu_id"));
- String name=ISOtoGb2312.convert(request.getParameter("name"));
- String sex=ISOtoGb2312.convert(request.getParameter("sex"));
- String age=ISOtoGb2312.convert(request.getParameter("age"));
- String dept=ISOtoGb2312.convert(request.getParameter("dept"));
- String ruxdate=ISOtoGb2312.convert(request.getParameter("ruxdate"));
- String tel=ISOtoGb2312.convert(request.getParameter("tel"));
- String address=ISOtoGb2312.convert(request.getParameter("address"));
- %>
- <%
- Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //载入驱动程序类别
- Connection con = DriverManager.getConnection("jdbc:odbc:dsn112"); //建立数据库链接
- Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
- ResultSet.CONCUR_READ_ONLY);
- String strSQL;
- strSQL="delete from Info where stu_id='"+stu_id+"'";
- stmt.executeUpdate(strSQL);
- String strsql;
- strsql="insert into Info(stu_id,name,sex,age,dept,ruxdate,tel,address) values('"+stu_id+"','"+name+"','"+sex+"','"+age+"','"+dept+"','"+ruxdate+"','"+tel+"','"+address+"')";
- stmt.executeUpdate(strsql);
- %>
- <br><br>
- <table border="0" width="90%" bgcolor="#EcEcff" align="center">
- <tr bgcolor="#fcd56c">
- <td align="center"><h3>你修改的信息如下</td>
- </tr>
- <tr>
- <td> 学 号:<%=stu_id%></td>
- </tr>
- <tr>
- <td> 姓 名:<%=name%></td>
- </tr>
- <tr>
- <td > 性 别:<%=sex%></td>
- </tr>
- <tr>
- <td > 出生年月:<%=age%></td>
- </tr>
- <tr>
- <td> 所学专业:<%=dept%></td>
- </tr>
- <tr>
- <td > 入学时间:<%=ruxdate%></td>
- </tr>
- <tr>
- <td> 联系方式:<%=tel%></td>
- </tr>
- <tr>
- <td> 住 址:<%=address%></td>
- </tr>
- <tr><td height="10"></td></tr>
- <tr>
- <td align="center"> <a href="change.jsp">返回,继续修改</a></td>
- </tr>
- <tr><td height="10"></td></tr>
- </table>
- <TABLE border="0" width="90%" align="center">
- <tr>
- <td height="10"></td>
- </tr>
- <tr>
- <td align="center"><hr /></td>
- </tr>
- <tr>
- <td height="10"></td>
- </tr>
- <tr>
- <td align="center"><font color="green"></font></td>
- </tr>
- </table>
- </BODY>
- </HTML>