<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.sql.*"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查询数据库</title>
</head>
<body>
<jsp:useBean id="db" scope="page" class="myBean.DBConnection" />
<p>数据库内容：
<table border="1" width="95%" align="center">
<tr>
	<td with="30%"><b>姓名</b></td>
	<td with="70%"><b>电子邮件</b></td>
</tr>
<%
	String sql= "select name, email from users";
	ResultSet rs = db.execQuery(sql);
	while(rs.next()) {
%>
<tr>
	<td>
	<%=rs.getString("name")%>
	</td>
	<td>
	<%=rs.getString("email")%>
	</td>
</tr>
<%
	}
%>
</table>
<a href="userinfo.jsp">返回</a>
</body>

</html>