Here you can find the source of printItems(ResultSet rs)
public static void printItems(ResultSet rs)
//package com.java2s; /*//from ww w .j av a 2 s . c om * Copyright 2000-2011 Enonic AS * http://www.enonic.com/license */ import java.sql.ResultSet; import java.sql.SQLException; public class Main { public static void printItems(ResultSet rs) { try { int columns = rs.getMetaData().getColumnCount(); for (int i = 0; i < columns; i++) { System.out.println(i + ": " + rs.getObject(i + 1)); } } catch (SQLException sqle) { sqle.printStackTrace(); } } }