Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
514
Chapter 18 JDBC and Database Connection Pooling
Listing 18.23 ConnectionPoolServlet3.java (continued)
DBResults results =
DatabaseUtilities.getQueryResults(connection,
query, true);
table = results.toHTMLTable("#FFAD00");
} catch(Exception e) {
table = "Exception: " + e;
}
response.setContentType("text/html");
// Prevent the browser from caching the response. See
// Section 7.2 of Core Servlets and JSP for details.
response.setHeader("Pragma", "no cache"); // HTTP 1.0
response.setHeader("Cache Control", "no cache"); // HTTP 1.1
PrintWriter out = response.getWriter();
String title = "Connection Pool Test (*No* Pooling)";
out.println(ServletUtilities.headWithTitle(title) +
"\n" +
"\n" +
table + "\n" +
"\n