Which is the preferred collection class to use for storing database ResultSets? I have multiple columns in the result set, and I combine them into their own data structure for each row. Which is the best Collection class to store the objects??
Originally posted by Bala Krishniah: Which is the preferred collection class to use for storing database ResultSets? I have multiple columns in the result set, and I combine them into their own data structure for each row. Which is the best Collection class to store the objects??
I've always found ArrayLists to be sufficient ( better than Vectors ).
sarah Marsh
Ranch Hand
Joined: Mar 06, 2001
Posts: 282
posted
0
Why ArrayLists is better than Vectors ? Thanks a lot.
Bosun Bello
Ranch Hand
Joined: Nov 06, 2000
Posts: 1503
posted
0
No, ArrayList & Vector are pretty much the same besides the fact that the methods in the vector class are synchronized. If you don't need synchronization, then use an ArrayList.
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Adam Hardy
Ranch Hand
Joined: Oct 09, 2001
Posts: 563
posted
0
I used CachedRowSet which is like resultset but remains alive after closing the connection. After that I sometimes make a bespoke bean for the data object and instantiate it in an array big enough (from .size() of the CachedRowSet)
Adam
I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
subject: preferred collection class for storing Resultset?