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

Jsp/Servlet

开发平台:

VBScript

  1. <%@page contentType="text/html; charset=gb2312"%>
  2. <%@ page import="java.sql.*" %>
  3. <%@ page import="proj112.*" %>
  4. <html>
  5. <body>
  6. <p align="center"><IMG height=127 width=793 src="image/003.jpg"></IMG></P>
  7.   <jsp:useBean id="a" class="proj112.ConnDB" scope="page">
  8.   </jsp:useBean>
  9. <script language="JavaScript">
  10. <!--
  11. function del(id)
  12. {
  13. if (confirm("您确信要删除吗?") )
  14.   top.location="del.jsp?id="+id
  15.  }
  16. </script>
  17.   <% request.setCharacterEncoding("gb2312");
  18. ResultSet rs = user.executeQuery("select * from student");  %>
  19. <table align="center" width="100%" border=2 bordercolorlight="#CC99FF" cellpadding="2" bordercolordark="#FFFFFF" cellspacing="2">
  20. <tr><td align="center" colspan=6><font color="blue" size="5">所有学生相关信息</font>
  21. <td align="center"><a href="addForm.jsp">添加一条纪录</a></div></td>
  22. </td>
  23. </tr>
  24. <tr>
  25. <td align=center><font color="#338822"><b> 学号 </font> </td>
  26. <td align=center><font color="#338822"><b> 姓名 </font> </td>
  27. <td align=center><font color="#338822"><b> 密码 </font> </td>
  28. <td align=center><font color="#338822"><b> 地址 </td>
  29. <td align=center><font color="#338822"><b> 年龄 </td>
  30. <td align=center><font color="#338822"><b> 宿舍 </td>
  31. <td align=center><font color="#338822"><b> 管理 </td>
  32. </tr>
  33. <% while (rs.next()) { //取得下一条记录 %>
  34. <tr>
  35. <td> <%=rs.getString("num")%> </td>
  36. <td> <%=rs.getString("UserName")%> </td>
  37. <td> <%=rs.getString("PassWord")%> </td>
  38. <td> <%=rs.getString("addr")%> </td>
  39. <td> <%=rs.getString("age")%> </td>
  40. <td> <%=rs.getString("bedroom")%> </td>
  41. <td align="center" width=20%><a href="getEditForm.jsp?id=<%=rs.getShort(1)%>">修改</a> | <a href="javascript:del(<%=rs.getShort(1)%>)">删除</a></td>
  42. </tr>
  43. <% }
  44. rs.close();
  45. %>
  46. </table>
  47. <br>
  48. <br>
  49. <br>
  50. <br>
  51. <p align=center>
  52. <a href=javascript:history.back();>返回</a> </p>
  53. </body>
  54. </html>