private void printBookInfo(PrintWriter out, ResultSet rs) throws Exception { out.println("<html><head>"); out.println("<title>图书信息</title>"); out.println("</head><body>"); out.println("<table border='1'><caption>图书信息</caption>"); out.println("<tr>"); out .println("<th>书名</th><th>作者</th><th>出版社</th><th>价格</th><th>发行日期</th>"); out.println("</tr>"); DbUtil util = new DbUtil(); while (rs.next()) { out.println("<tr>"); out .println("<td>" + util.ISOTOGBK(rs.getString("title")) + "</td>"); out.println("<td>" + util.ISOTOGBK(rs.getString("author")) + "</td>"); out.println("<td>" + util.ISOTOGBK(rs.getString("bookconcern")) + "</td>"); out.println("<td>" + util.ISOTOGBK(rs.getFloat("price") + "</td>")); out.println("<td>" + util.ISOTOGBK(rs.getDate("publisher_date") + "</td>")); out.println("</tr>"); } out.println("</table>"); out.println("</body></html>"); }