ResultSetMetaData md = rs.getMetaData();
int count = md.getColumnCount();
println("<table border=1>");
print("<tr>");
for (int i=1; i<=count; i++) {
print("<th>");
print(md.getColumnLabel(i));
}
println("</tr>");
while (rs.next()) {
print("<tr>");
for (int i=1; i<=count; i++) {
print("<td>");
print(rs.getString(i));
}
println("</tr>");
}
println("</table>");