123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- <%@page import="java.sql.ResultSet"%>
- <%@page import="java.sql.PreparedStatement"%>
- <%@page import="java.sql.Statement"%>
- <%@page import="java.sql.DriverManager"%>
- <%@page import="java.sql.Connection"%>
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Insert title here</title>
- <style type="text/css">
- *{
- margin: 0;
- padding: 0;
- }
- body{
- padding: 10px 50px;
- }
- #wrap{
- width: 800px;
- margin: 10px auto;
- font-family: 'trebuchet MS','Lucida sans',Arial;/*字体效果*/
- font-size: 14px;
- color: #444;
- }
- table{
- *border-collapse:collapse;/*border-collapse用于表格属性,表示表格的两边框合并成一条*/
- border-spacing: 0;/*border-spacing属性设置相邻单元格的边框的距离*/
- width: 100%;
- }
- /*======bordered table======*/
- /*-moz代表firefox浏览器私有属性,-ms代表ie浏览器私有属性,-webkit代表safari、chrome私有属性。这些是为了兼容老版本的写法,比较新版本的浏览器都支持直接写:border-radius。*/
- .bordered{
- border: solid #ccc 1px;
- -moz-border-radius:6px;
- -webkit-border-radius:6px;
- border-radius: 6px; /*添加圆角边框:*/
- -wekit-box-shadow:0 1px 1px #ccc;
- -moz-box-shadow:0 1px 1px #ccc;
- box-shadow: 0 1px 1px #ccc; /*向方框添加阴影。*/
- }
- .bordered tr{
- -o-transition:all 0.1s ease-in-out;/*过渡效果*/
- -webkit-transition:all 0.1s ease-in-out;
- -moz-transition:all 0.1s ease-in-out;
- -ms-transition:all 0.1s ease-in-out;
- transition:all 0.1s ease-in-out;
- }
- .bordered highlight,.bordered tr:hover{background: #fbf8e9;} /*hover:当鼠标经过时会颜色的变化*/
- .bordered td,.bordered th{
- border-left: 1px solid #ccc;
- border-top: 1px solid #ccc;
- padding: 10px;
- text-align: left; /*左对齐元素中的文本*/
- }
- .bordered th{
- border-color: #dce9f9; /*-webkit safari、chrome私有属性 linear-gradient()函数用于创建一个线性渐变的 "图像"*/
- background-image: -webkit-gradient(linear,left top,left bottom,from(#ebf3fc),to(#dce9f9));
- background-image: -webkit-linear-gradient(top,#ebf3fc,#dce9f9);
- background-image: -moz-linear-gradient(top,#ebf3fc,#dce9f9);
- background-image: -ms-linear-gradient(top,#ebf3fc,#dce9f9);
- background-image: -o-linear-gradient(top,#ebf3fc,#dce9f9);
- background-image: linear-gradient(top,#ebf3fc,#dce9f9);
- filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#ebf3fc,endColorstr=#dce9f9); /*ie提供的css渲染*/
- -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#ebf3fc,endColorstr=#dce9f9)";
- -webkit-box-shadow:0 1px 0 raba(255,255,255,.8) inset; /*ie提供的css渲染*/
- -moz-box-shadow:0 1px 0 raba(255,255,255,.8) inset;
- box-shadow:0 1px 0 raba(255,255,255,.8) inset; /*内阴影*/
- border-top: none;
- text-shadow:0 1px 0 raba(255,255,255,.5);
- }
- .bordered td:first-child,.bordered th:first-child{
- border-left: none;
- }
- .bordered th:first-child{
- -moz-border-radius:6px 0 0 0;
- -webkit-border-radius:6px 0 0 0;
- border-radius:6px 0 0 0;
- }
- .bordered th:last-child{
- -moz-border-radius:0 6px 0 0;
- -webkit-border-radius:0 6px 0 0;
- border-radius:0 6px 0 0;
-
- }
- .bordered tr:last-child td:first-child{
- -moz-border-radius:0 0 0 6px;
- -webkit-border-radius:0 0 0 6px;
- border-radius:0 0 0 6px;
- }
- .bordered tr:last-child td:last-child{
- -moz-border-radius:0 0 6px 0;
- -webkit-border-radius:0 0 6px 0;
- border-radius:0 0 6px 0;
- }
- .a{
- color:blue;
- }
- .button{
- background: url(images/button-bg.png) repeat-x top center;
- border: 1px solid #999;
- -moz-border-radius:4px;
- -webkit-border-radius:4px;
- border-radius:4px;
- padding: 5px;
- color: black;
- font-weight: bold;
- font-size: 13px;
- width: 70px;
- }
- .button:hover{
- background: white;
- color: black;
- }
- </style>
- </head>
- <body>
- <table align="center" border="1" width="80%" class="bordered">
- <tr>
- <th>序号</th>
- <th>姓名</th>
- <th>性别</th>
- <th>电话</th>
- <th>邮箱</th>
- <th>年龄</th>
- <th>部门</th>
- <th>操作</th>
- </tr>
- <%
- String key=request.getParameter("name");
- String driver="com.mysql.cj.jdbc.Driver";
- String url="jdbc:mysql://localhost:3306/edu?characterEncoding=utf-8"
- + "&serverTimezone=UTC";
- String user="root";
- String password="1234";
- Class.forName(driver);
- Connection conn=DriverManager.getConnection(url,user,password);
- //插入数据
- String sql="SELECT*FROM manager1 where name=?";
- PreparedStatement pstmt=conn.prepareStatement(sql);
- pstmt.setString(1, key);
- ResultSet rs = pstmt.executeQuery();
- int i=1;
- while(rs.next()) {
- %>
- <%
- out.println("<tr>");
- out.println("<td name=\"count\">" + rs.getString("count") + "</td>");
- out.println("<td id='name'>" + rs.getString("name") + "</td>");
- out.println("<td>" + rs.getString("gender") + "</td>");
- out.println("<td>" + rs.getString("telephone") + "</td>");
- out.println("<td>" + rs.getString("mailbox") + "</td>");
- out.println("<td>" + rs.getInt("age") + "</td>");
- out.println("<td>" + rs.getString("department") + "</td>");
-
-
- out.println("<td><div><a href='../delete?count=" + rs.getString("count") + "'><button>删除</button></a></div><div><a href='change.jsp?count=" + rs.getString("count") + "'><button>修改</button></a></div></td>");
- out.println("</tr>");
- %>
- </table>
- <%
- }
- pstmt.close();
- conn.close();
- %>
- </body>
- </html>
|