update.jsp~22~
上传用户: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><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 height="5"></td>
  46.   </tr>
  47.   <tr>
  48.     <td>&nbsp;&nbsp;&nbsp;&nbsp;姓   名:<%=name%></td>
  49.   </tr>
  50.   <tr>
  51.     <td height="5"></td>
  52.   </tr>
  53.   <tr>
  54.     <td >&nbsp;&nbsp;&nbsp;&nbsp;性   别:<%=sex%></td>
  55.   </tr>
  56.   <tr>
  57.     <td height="5"></td>
  58.   </tr>
  59.   <tr>
  60.     <td >&nbsp;&nbsp;&nbsp;&nbsp;出生年月:<%=age%></td>
  61.   </tr>
  62.   <tr>
  63.     <td height="5"></td>
  64.   </tr>
  65.   <tr>
  66.     <td>&nbsp;&nbsp;&nbsp;&nbsp;所学专业:<%=dept%></td>
  67.   </tr>
  68.   <tr>
  69.     <td height="5"></td>
  70.   </tr>
  71.   <tr>
  72.     <td >&nbsp;&nbsp;&nbsp;&nbsp;入学时间:<%=ruxdate%></td>
  73.   </tr>
  74.   <tr>
  75.     <td height="5"></td>
  76.   </tr>
  77.   <tr>
  78.     <td>&nbsp;&nbsp;&nbsp;&nbsp;联系方式:<%=tel%></td>
  79.   </tr>
  80.   <tr>
  81.     <td height="5"></td>
  82.   </tr>
  83.   <tr>
  84.     <td>&nbsp;&nbsp;&nbsp;&nbsp;住   址:<%=address%></td>
  85.   </tr>
  86.   <tr><td height="10"></td></tr>
  87.   <tr>
  88.     <td  align="center">&nbsp;&nbsp;&nbsp;&nbsp;<a href="change.jsp">返回,继续修改</a></td>
  89.   </tr>
  90.   <tr><td height="10"></td></tr>
  91. </table>
  92. <TABLE border="0" width="90%" align="center">
  93.        <tr>
  94.          <td height="10"></td>
  95.        </tr>
  96.        <tr>
  97.          <td align="center"></td>
  98.        </tr>
  99.        <tr>
  100.          <td height="10"></td>
  101.        </tr>
  102. </table>
  103. </BODY>
  104. </HTML>