日期:2014-05-17 浏览次数:20859 次
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="java.sql.*"%>
<%
//驱动类名
String className = "org.gjt.mm.mysql.Driver";
// 数据库URL
String url = "jdbc:mysql://localhost/win";
// 用户名
String userName = "root";
// 密码
String password = "";
String listSql = "select * from email_history order by id limit 1,100";
String deleteSql = "delete from email_history where id in (%s)";
Class.forName(className);
Connection conn = DriverManager.getConnection(url, userName, password);
Statement stmt = conn.createStatement();
String deleteIds = request.getParameter("deleteIds");
if(deleteIds!=null && !"".equals(deleteIds)) {
stmt.execute(String.format(deleteSql, deleteIds));
}
%>
<html>
<head>
<title>会议信息</title>
</head>
<body>
<table border="1">
<%
ResultSet rs = stmt.executeQuery(listSql);
String ids = "";
while (rs.next()){
ids += "," + rs.getInt("id");
%>
<tr>
<td><input type="checkbox" id='checkbox_<%=rs.getInt("id") %>' name='checkbox_<%=rs.getInt("id") %>' onclick="doCheck()" /></td>
<td><%=rs.getInt("id") %></td>
<td><%=rs.getString("title") %></td>
<td><%=rs.getString("from_email").replaceAll("<","<").replaceAll(">",">") %></td>
<td><%=rs.getString("to_email") %></td>
</tr>
<%
}
if(!"".equals(ids)) {
ids = ids.substring(1);
}
%>
<tr>
<td colspan="5">
<input type="checkbox" id="checkall" name="chec