adminstudent4.jsp
上传用户:mkymky1985
上传日期:2014-06-23
资源大小:754k
文件大小:2k
源码类别:

其他数据库

开发平台:

Java

  1. <%@ page language = "java" contentType = "text/html;charset=gb2312"%>
  2. <%@ page import = "java.sql.*,wsxk.*" %>
  3. <jsp:useBean id="subject" scope="page" class="wsxk.ConDB"/>
  4. <%! String trans(String chi)
  5. {
  6.                String result = null;
  7.                byte temp [];
  8.                try
  9.                 {
  10.                       temp=chi.getBytes("iso-8859-1");
  11.                       result = new String(temp, "gb2312");
  12.                 }
  13.                 catch(Exception e)
  14.                 {
  15.                         System.out.println (e.toString());
  16.                 }
  17.                 return result;
  18. }
  19. %>
  20. <%
  21. String stuid = new String (request.getParameter("stuid"));
  22. String stuname = new String (request.getParameter("stuname"));
  23. String stuno = new String (request.getParameter("stuno"));
  24. String stugrade = new String (request.getParameter("stugrade"));
  25. String stupsw = new String (request.getParameter("stupsw"));
  26. stugrade=stugrade.trim();
  27. stugrade=trans(stugrade);
  28. System.out.print(stugrade);
  29. if (stugrade.equals("大一"))
  30. stugrade="1";
  31. if (stugrade.equals("大二"))
  32. stugrade="2";
  33. if (stugrade.equals("大三"))
  34. stugrade="3";
  35. if (stugrade.equals("大四"))
  36. stugrade="4";
  37. //System.out.println("EEEE333");
  38. String str = null;
  39. String str2 = "";
  40. %>
  41. <% if (stuname.trim().equals("")||stuno.trim().equals("")||stupsw.trim().equals(""))
  42. {response.sendRedirect("adminstudenterr.htm");}
  43. else{String sql2 = "update student  set stupsw = '"+stupsw+"',stuname = '"+trans(stuname)+"',stuno = '"+stuno+"',stugrade = '"+stugrade+"' where stuid = '"+stuid+"'";//(stupsw, stuname, stuno, stugrade) values('" +stupsw+ "','" + trans(stuname) + "','" + stuno + "','" +stugrade+ "')";
  44. subject.executeUpdate(sql2);}
  45. %>
  46. <html>
  47. <head>
  48. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  49. <meta HTTP-EQUIV=REFRESH CONTENT="10; URL=adminstudent.jsp">
  50. <link href="_notes/aaa.css" rel="stylesheet" type="text/css">
  51. <style type="text/css">
  52. <!--
  53. @import url("_notes/ccc");
  54. body,td,th {
  55. font-size: 12px;
  56. color: #FFFFFF;
  57. font-weight: bold;
  58. }
  59. .style1 {color: #000000}
  60. -->
  61. </style>
  62. </HEAD>
  63. <BODY BGCOLOR=#0D85A6 BACKGROUND="images/bg.gif" >
  64. <div align="center">
  65.   <p align="left">    <br>
  66.   学生信息修改成功,本页将于10秒内自动<a href="adminstudent.jsp" class="style1">返回学生管理页面</a></p>
  67.   <p><br>
  68.     <img src="images/qa.jpg" width="640" height="427"></p>
  69. </div>
  70. </BODY>
  71. </HTML>