<%@ page contentType = "text/html; charset=GB2312" %>
<%@ page import ="java.sql.*" %>
<html>
<head>
<title>数据表一览</title>
</head>
<body>
<%! char sex;%>
<b><center>
<font size=4 color=red>regi 数据库的rgst数据表一览</font><br><hr><br>
<%
Class.forName("sun.jdbc.odbc.jdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc
dbc:regi");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM rgst");
%>
<table bgcolor=black>
<tr bgcolor="#FFFF00">
<td><b><div><center>姓名</center></div></b></td>
<td><b><div><center>性别</center></div></b></td>
<td><b><div><center>年龄</center></div></b></td>
<td><b><div><center>出生日期</center></div></b></td>
<td><b><div><center>工资</center></div></b></td>
</tr>
<%
while(rs.next())
{
if(rs.getBoolean("性别")) sex='女';
else sex='男';
%>
<tr bgcolor=cyan>
<td><b><div><center><%= rs.getString("姓名")%></center></div></b></td>
<td><b><div><center><%= sex %></center></div></b></td>
<td><b><div><center><%= rs.getInt("年龄")%></center></div></b></td>
<td><b><div><center><%= rs.getDate("出生日期")%></center></div></b></td>
<td><b><div><center><%= rs.getFloat("工资")%></center></div></b></td>
</tr>
<%
}
rs.close();
stmt.close();
con.close();
%>
</table>
</center></b>
</body>
</html>