<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><%@ page language="java" contentType="text/html; charset=UTF-8"? ? pageEncoding="UTF-8" ?import="java.sql.*"%><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>普通話水平測試報名系統(tǒng)</title></head><body><center>? <p> </p>? <p> </p>? <p> </p>? <p class="STYLE1">報名信息查詢</p>? <form method="post" action="xx-ym.jsp">? <p> </p>? <p>?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? <input type="submit" name="Submit" value="返回">? </p></form>? <table height="40" border="1" align="center" ><tr><td width="40" ?style="display:none;">報名序號</td>?<td width="100">學號</td><td width="100">姓名</td><td width="100">學院</td><td width="100">專業(yè)</td><td width="100">班級</td><td width="150">身份證號碼</td><td width="40">性別</td><td width="100">出生年月</td><td width="100">籍貫</td><td width="80">名族</td><td width="90">聯(lián)系電話</td></tr></table></center><%request.setCharacterEncoding("UTF-8");String bj=request.getParameter("a1");String driverClass="com.mysql.jdbc.Driver";String url="jdbc:mysql://localhost:3306/atao";String uname="root";String upass="958672";Connection conn=null;Class.forName(driverClass);conn=DriverManager.getConnection(url,uname,upass);PreparedStatement stmt=conn.prepareStatement("select * from student where classes=?");stmt.setString(1,bj); ResultSet rs=stmt.executeQuery(); while(rs.next()){ %> <center> <%? ? ? ? String exportToExcel = request.getParameter("exportToExcel");? ? ? ? if (exportToExcel != null? ? ? ? ? ? ? ? && exportToExcel.toString().equalsIgnoreCase("YES")) {? ? ? ? ? ? response.setContentType("application/vnd.ms-excel");? ? ? ? ? ? response.setHeader("Content-Disposition", "inline; filename="? ? ? ? ? ? ? ? ? ? + "excel.xls");?? ? ? ? }? ? %> <form action="" method="post"> <table height="40" border="1" align="center" ><tr><td width="40" ?style="display:none;"> <%=rs.getString(12)%></td><td width="100"><%=rs.getString(1) %></td><td width="100"> <%=rs.getString(2) %></td><td width="100"> <%=rs.getString(3) %></td><td width="100"> <%=rs.getString(4) %></td><td width="100"> <%=rs.getString(5) %></td><td width="150"> <%=rs.getString(6) %></td><td width="40"> <%=rs.getString(7) %></td><td width="100"> <%=rs.getString(8) %></td><td width="100"> <%=rs.getString(9) %></td><td width="80"> <%=rs.getString(10) %></td><td width="90"> <%=rs.getString(11) %></td>? ? ? </table> ? ? ?<p align="right"> ? ? ? ? ? <%? ? ? ? if (exportToExcel == null) {? ? %> ? ? ? ? ? ? ? ? ? ? ?<a href="ycx-conf.jsp?exportToExcel=YES">Export to Excel</a>? ? ? ? ? ? ? ?<%? ? ? ? }? ? %>? ? ? ? ? ? ? ?</center>? ? ? ? ? ? ? ?<% ? ? ? ? ? ? ?}? ? ? ?? rs.close(); stmt.close(); conn.close();? %>? ? ? ? ? ??? ? ? ? ? ? ? ?</tr></p> ? ? ? ? <p> </p> ? ? ? ? <p> </p> </form> </body></html>
添加回答
舉報
0/150
提交
取消