List of utility methods to do SQL ResultSet Print
void | printRecord(PrintWriter pw, ResultSet rs) print Record ResultSetMetaData rsmd = rs.getMetaData(); printRecord(pw, rs, rsmd); |
void | printResult(ResultSet rs) print Result ResultSetMetaData rsmd = (ResultSetMetaData) rs.getMetaData(); int colNum = rsmd.getColumnCount(); while (rs.next()) { for (int i = 0; i < colNum; i++) System.out.printf(rs.getString(i + 1) + " "); System.out.println(); |
void | printResults(final ResultSet results) print Results while (results.next()) { final ResultSetMetaData meta = results.getMetaData(); final int colCnt = meta.getColumnCount(); for (int i = 1; i <= colCnt; ++i) { final String str = results.getString(i); System.out.print(meta.getColumnName(i) + ":" + str + " "); System.out.println(); ... |
int | printResults(ResultSet rst) Helper method to print out the resultSet. ResultSetMetaData meta = rst.getMetaData(); int numColumns = meta.getColumnCount(); System.out.print(meta.getColumnName(1)); for (int j = 2; j <= meta.getColumnCount(); j++) System.out.print(", " + meta.getColumnName(j)); System.out.println(); int count = 0; while (rst.next()) { ... |
String | printResultSet(List
print Result Set StringBuffer out = new StringBuffer(); char delim = '\t'; for (String name : colNames) { out.append(name).append(delim); if (out.length() > 0) out.delete(out.length() - 1, out.length()); out.append('\n'); ... |
String | printResultSet(ResultSet rs) print Result Set StringBuilder sb = new StringBuilder(); try { ResultSetMetaData rsMeta = rs.getMetaData(); int colCount = rsMeta.getColumnCount(); int count = 0; while (rs.next()) { sb.append(count++); sb.append("-------------------------------------------------------\r\n"); ... |
void | printResultSet(ResultSet rs) print Result Set PrintWriter pw = new PrintWriter(System.out);
printResultSet(rs, 100, true, pw);
pw.flush();
|
void | printResultSet(ResultSet rs) Print a ResultSet to System.out. ResultSetMetaData rsmd = rs.getMetaData(); for (int i = 1; i <= rsmd.getColumnCount(); i++) { if (i != 1) { System.out.print(", "); System.out.print(rsmd.getColumnName(i)); System.out.println(); ... |
void | printResultSet(ResultSet rs) print Result Set printResultSet(rs, System.out); |
void | printResultSet(ResultSet rs) print Result Set ResultSetMetaData metaData = rs.getMetaData(); int numColumns = printResultSetHeader(metaData); while (rs.next()) { printResultSetRow(rs, numColumns); |