0

I want to put ResultSet data into something i can forward to a JSP from a Servlet. Should i be looking into getObject() from the ResultSet interface to make a java List? Is there an easier way?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
aLk
  • 19
  • 2
  • 3
  • This question looks pretty much like yours: http://stackoverflow.com/questions/384189/how-do-i-make-a-java-resultset-available-in-my-jsp – Art Licis Dec 24 '10 at 08:37
  • So an ArrayList of Arraylists would be my best option? – aLk Dec 24 '10 at 09:35
  • No, that isn't what the accepted answer in the given link is recommending. Here are another duplicates: http://stackoverflow.com/questions/1831053/displaying-multiple-records-by-using-resultset/1832524#1832524 and http://stackoverflow.com/questions/2280034/jsp-helper-class-for-printing-content/2280358#2280358 – BalusC Dec 24 '10 at 13:11

2 Answers2

1

Apache commons-dbutils can be used to easily do this

Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140
1

use bean classes and set the data accordingly in each bean object. Put bean objects into the Arraylist object and set it into the request object.

Priyanjan
  • 329
  • 3
  • 5