Here you can find the source of printSet(ResultSet set, int columns)
public static void printSet(ResultSet set, int columns) throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static void printSet(ResultSet set, int columns) throws SQLException { while (set.next()) { for (int i = 1; i <= columns; i++) { System.out.print(set.getString(i) + ", "); }//w w w .j a v a 2s.com System.out.println(); } } }