Package com.mckoi.util
Class ResultOutputUtil
- java.lang.Object
-
- com.mckoi.util.ResultOutputUtil
-
public class ResultOutputUtil extends java.lang.Object
Utilities for parsing a ResultSet and outputing it in different forms. The forms included are straight text (mono-spaced), HTML, etc.
-
-
Constructor Summary
Constructors Constructor Description ResultOutputUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
formatAsText(java.sql.ResultSet result_set, java.io.PrintWriter out)
Formats the ResultSet as plain mono-spaced text and outputs the result to the PrintWriter.private static void
writeBreak(int[] widths, java.io.PrintWriter out)
Writes a break.private static void
writeRow(int[] widths, java.lang.String[] cols, java.io.PrintWriter out)
Writes a row of data.
-
-
-
Method Detail
-
writeBreak
private static void writeBreak(int[] widths, java.io.PrintWriter out)
Writes a break. eg. "+--------+----------+---------------+"
-
writeRow
private static void writeRow(int[] widths, java.lang.String[] cols, java.io.PrintWriter out)
Writes a row of data. eg. "|1 |Greetings |Part-54445 |"
-
formatAsText
public static void formatAsText(java.sql.ResultSet result_set, java.io.PrintWriter out) throws java.sql.SQLException
Formats the ResultSet as plain mono-spaced text and outputs the result to the PrintWriter.- Throws:
java.sql.SQLException
-
-