FileDocCategorySizeDatePackage
ResultsDecoratorHTML.javaAPI DocExample1081Thu Mar 25 20:39:34 GMT 2004None

ResultsDecoratorHTML

public class ResultsDecoratorHTML extends ResultsDecorator
Print ResultSet in HTML

Fields Summary
Constructors Summary
ResultsDecoratorHTML(ResultsDecoratorPrinter out)

		super(out);
	
Methods Summary
java.lang.StringgetName()
Return a printable name for this decorator

see
ResultsDecorator#getName()

		return "HTML";
	
public voidwrite(java.sql.ResultSet rs)


		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>");
	
voidwrite(int updateCount)

		println("<p>RowCount: updateCount = <b>" + 
					updateCount + "</p>");