<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
< %@page import="java.sql.*"%>
< %@page contentType="text/html; charset=gb2312"%>
<html>
<style type="text/css">
<!--
.style1 {
font-family: "宋体";
font-size: 14px;
}
-->
</style>
<head>
<title>person_show</title>
</head>
<body>
<table>
<table width="800" border="1" cellspacing="0" bordercolor="#336666">
<tr>
<td align="center" nowrap>ID</td>
<td align="center" nowrap ><span class="style1">姓名</span></td>
<td align="center" nowrap><span class="style1">性别</span></td>
<td align="center" nowrap><span class="style1">年龄</span></td>
<td align="center" nowrap><span class="style1">电话</span></td>
<td align="center" nowrap><span class="style1">住址</span></td>
<td align="center" nowrap><span class="style1">Email</span></td>
<td align="center" nowrap><span class="style1">操作</span></td>
</tr>
<%
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/user_table","root","mzq8293");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from users");
while(rs.next())
{
%>
<tr class="style1">
<td align="center" class="style1"><%=rs.getString("id")%></td>
<td align="center"><%=rs.getString("name")%></td>
<td align="center"><%=rs.getInt("sex") == 0 ? "男":"女"%></td>
<td align="center"><%=rs.getString("age")%></td>
<td align="center"><%=rs.getString("phone")%></td>
<td align="center"><%=rs.getString("address")%></td>
<td align="center"><%=rs.getString("email")%></td>
<td align="center">修改 || 删除</td>
</tr>
<%
}
%>
<%
rs.close();
stmt.close();
conn.close();
%>
</table>
<p align="center">添加 返回</p>
</body>
</html>
< %@page import="java.sql.*"%>
< %@page contentType="text/html; charset=gb2312"%>
<html>
<style type="text/css">
<!--
.style1 {
font-family: "宋体";
font-size: 14px;
}
-->
</style>
<head>
<title>person_show</title>
</head>
<body>
<table>
<table width="800" border="1" cellspacing="0" bordercolor="#336666">
<tr>
<td align="center" nowrap>ID</td>
<td align="center" nowrap ><span class="style1">姓名</span></td>
<td align="center" nowrap><span class="style1">性别</span></td>
<td align="center" nowrap><span class="style1">年龄</span></td>
<td align="center" nowrap><span class="style1">电话</span></td>
<td align="center" nowrap><span class="style1">住址</span></td>
<td align="center" nowrap><span class="style1">Email</span></td>
<td align="center" nowrap><span class="style1">操作</span></td>
</tr>
<%
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/user_table","root","mzq8293");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from users");
while(rs.next())
{
%>
<tr class="style1">
<td align="center" class="style1"><%=rs.getString("id")%></td>
<td align="center"><%=rs.getString("name")%></td>
<td align="center"><%=rs.getInt("sex") == 0 ? "男":"女"%></td>
<td align="center"><%=rs.getString("age")%></td>
<td align="center"><%=rs.getString("phone")%></td>
<td align="center"><%=rs.getString("address")%></td>
<td align="center"><%=rs.getString("email")%></td>
<td align="center">修改 || 删除</td>
</tr>
<%
}
%>
<%
rs.close();
stmt.close();
conn.close();
%>
</table>
<p align="center">添加 返回</p>
</body>
</html>
7712

被折叠的 条评论
为什么被折叠?



