FileDocCategorySizeDatePackage
ResultsDecoratorText.javaAPI DocExample913Thu Mar 25 20:39:34 GMT 2004None

ResultsDecoratorText

public class ResultsDecoratorText extends ResultsDecorator
Print a ResultSet in plain text.
version
$Id: ResultsDecoratorText.java,v 1.3 2004/03/26 02:39:33 ian Exp $

Fields Summary
Constructors Summary
ResultsDecoratorText(ResultsDecoratorPrinter pt)

		super(pt);
	
Methods Summary
java.lang.StringgetName()

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

		ResultSetMetaData md = rs.getMetaData();
		int cols = md.getColumnCount();
		for (int i = 1; i <= cols; i++) {
			print(md.getColumnName(i) + "\t");
		}
		println();
		while (rs.next()) {
			for (int i = 1; i <= cols; i++) {
				print(rs.getString(i) + "\t");
			}
			println();
		}
	
voidwrite(int rowCount)

		println("OK: " + rowCount);