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

Jsp/Servlet

开发平台:

VBScript

  1. <%@ page contentType="text/html; charset=GB2312" %>
  2. <%@ page import = "java.sql.*"%>
  3. <%@ page language = "java"%>
  4. <%@ page import = "proj112.ISOtoGb2312"%>
  5. <HTML>
  6. <HEAD>
  7. <TITLE>update</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. <%
  15. String stu_id=ISOtoGb2312.convert(request.getParameter("stu_id"));
  16. String name=ISOtoGb2312.convert(request.getParameter("name"));
  17. String sex=ISOtoGb2312.convert(request.getParameter("sex"));
  18. String age=ISOtoGb2312.convert(request.getParameter("age"));
  19. String dept=ISOtoGb2312.convert(request.getParameter("dept"));
  20. String ruxdate=ISOtoGb2312.convert(request.getParameter("ruxdate"));
  21. String tel=ISOtoGb2312.convert(request.getParameter("tel"));
  22. String address=ISOtoGb2312.convert(request.getParameter("address"));
  23. %>
  24. <%
  25. Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //载入驱动程序类别
  26. Connection con = DriverManager.getConnection("jdbc:odbc:dsn112"); //建立数据库链接
  27. Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
  28. ResultSet.CONCUR_READ_ONLY);
  29. String strSQL;
  30. strSQL="delete from Info where stu_id='"+stu_id+"'";
  31. stmt.executeUpdate(strSQL);
  32. String strsql;
  33. strsql="insert into Info(stu_id,name,sex,age,dept,ruxdate,tel,address) values('"+stu_id+"','"+name+"','"+sex+"','"+age+"','"+dept+"','"+ruxdate+"','"+tel+"','"+address+"')";
  34. stmt.executeUpdate(strsql);
  35. %>
  36. <br><br>
  37. <table border="0" width="90%" bgcolor="#EcEcff" align="center">
  38.   <tr bgcolor="#fcd56c">
  39.     <td align="center"><h3>你修改的信息如下</td>
  40.   </tr>
  41.  <tr>
  42.     <td>&nbsp;&nbsp;&nbsp;&nbsp;学   号:<%=stu_id%></td>
  43.   </tr>
  44.   <tr>
  45.     <td>&nbsp;&nbsp;&nbsp;&nbsp;姓   名:<%=name%></td>
  46.   </tr>
  47.   <tr>
  48.     <td >&nbsp;&nbsp;&nbsp;&nbsp;性   别:<%=sex%></td>
  49.   </tr>
  50.   <tr>
  51.     <td >&nbsp;&nbsp;&nbsp;&nbsp;出生年月:<%=age%></td>
  52.   </tr>
  53.   <tr>
  54.     <td>&nbsp;&nbsp;&nbsp;&nbsp;所学专业:<%=dept%></td>
  55.   </tr>
  56.   <tr>
  57.     <td >&nbsp;&nbsp;&nbsp;&nbsp;入学时间:<%=ruxdate%></td>
  58.   </tr>
  59.   <tr>
  60.     <td>&nbsp;&nbsp;&nbsp;&nbsp;联系方式:<%=tel%></td>
  61.   </tr>
  62.   <tr>
  63.     <td>&nbsp;&nbsp;&nbsp;&nbsp;住   址:<%=address%></td>
  64.   </tr>
  65.   <tr><td height="10"></td></tr>
  66.   <tr>
  67.     <td  align="center">&nbsp;&nbsp;&nbsp;&nbsp;<a href="change.jsp">返回,继续修改</a></td>
  68.   </tr>
  69.   <tr><td height="10"></td></tr>
  70. </table>
  71. <TABLE border="0" width="90%" align="center">
  72.        <tr>
  73.          <td height="10"></td>
  74.        </tr>
  75.        <tr>
  76.          <td align="center"><hr /></td>
  77.        </tr>
  78.        <tr>
  79.          <td height="10"></td>
  80.        </tr>
  81.        <tr>
  82.          <td align="center"><font  color="green"></font></td>
  83.        </tr>
  84. </table>
  85. </BODY>
  86. </HTML>