The SqlResultSet class provides a collection of column names as property
getColumnNames
and rows as objects of class SqlTuple. These can be iterated using Javafor
loops as in the following code snippet:SqlResultSet result = con.executeQuery("select pk,value from MyTable where pk>=?", 2013); for (String column : result.getColumnNames()) { System.out.print(column + ", "); } System.out.println(); for (SqlTuple tuple : result) { System.out.println(tuple.getInt(0) + ", " + tuple.get("value")); }