%@ page language="java" import="java.util.*" import="java.sql.*"
pageEncoding="gb2312"%><%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>"> <title>My JSP 'Result.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> </head> <body> <table bgcolor="#ffff99" border=2>
<tr>
<th>
姓 名
</th>
<th>
性 别
</th>
<th>
身 份 证
</th>
<th>
工 作 单 位
</th>
<th>
家 庭 住 址
</th>
<th>
联 系 方 式
</th>
<th>
是否删除
</th>
</tr> <%
String way = request.getParameter("adr");
String result = request.getParameter("password");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn = DriverManager.getConnection("jdbc:odbc:DSSchool");
Statement stat = conn.createStatement();
out.println(way+" "+result);
String sql = "SELECT name,sex,identify,gov,address,phoneno FROM STUDENT WHERE "
+ way + " = '" + result + "'";
ResultSet rs = stat.executeQuery(sql);
//int flag = 0;
while (rs.next()) {
String name1 = rs.getString("name");
String sex1 = rs.getString("sex");
String identify1 = rs.getString("identify");
String gov1 = rs.getString("gov");
String address1 = rs.getString("address");
String phoneno1 = rs.getString("phoneno");
%>
<tr>
<td>
<%
out.print(name1);
%>
</td>
<td>
<%
out.print(sex1);
%>
</td>
<td>
<%
out.print(identify1);
%>
</td>
<td>
<%
out.print(gov1);
%>
</td>
<td>
<%
out.print(address1);
%>
</td>
<td>
<%
out.print(phoneno1);
%>
</td>
<td>
<a href="Delete.jsp"> 删除 </a>
</td>
</tr>

<%
}
stat.close();
conn.close();
%> </table> </body>
</html>jsp数据库