The result set I'm speaking of this:
http://docs.oracle.com/javase/1.4.2/docs/api/java/sql/ResultSet.html
What I would like to do is this…
for row in rows
for col in row
//col is the name of the column, row[col] is the value.
I'm more profecient in PHP, than JSP, fyi. This would be done in PHP like so:
foreach($rs as $row)
foreach($row as $col => $val)
//val is the cell value, and column is the column name
EDIT: I'm looking for a generic solution. notice how col is a variable, not a literal.
Best Answer
This is just a variation the a_horse_with_no_name answer. Here we use a
List
ofList
objects as suggested there.Edit Added final to all variables.