Here you can find the source of printResultSet(ResultSet rs)
public static void printResultSet(ResultSet rs) throws SQLException
//package com.java2s; import java.sql.*; public class Main { /**// ww w .ja v a2 s . c om * Print a ResultSet to System.out. This is useful for debugging tests. */ public static void printResultSet(ResultSet rs) throws SQLException { 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(); while (rs.next()) { for (int i = 1; i <= rsmd.getColumnCount(); i++) { if (i != 1) { System.out.print(", "); } System.out.print(rs.getString(i)); } System.out.println(); } } }