I'm looking for some of your recommendations on what the best method
is for returning a ResultSet from a Java class that will be displayed
on a JSP. The JSP would instantiate an object of this class, call a
method, and get a ResultSet in return. The issue, obviously, is I
cannot close the connection until after use in the JSP. Ideally I'd
like to close the connection and preparedStatement (etc.) right away
as that seems the proper thing to do.
How have some of you handled this in the past? Do you call a
separate close method after displaying the table/grid? Do you
convert the RS to an arraylist, vector, map, etc? If so, would you
be willing to provide links or examples as to why one would choose
one type over another?