posted 23 years ago
I don't think Adrian's solution will work. ResultSet.next returns a boolean indicating whether there is another record in the ResultSet. ResultSet.next does not return the next record in the ResultSet. This solution will not compile because Vector.add expects an Object and ResultSet.next returns a primitive.
As far as I know there's no quick and easy way to do what you want. ResultSets can be a pain.
What I would do is write a class that has instance variables for each column in the table. Then step through the resultset with a while loop. In the loop perform these three steps. 1) Create an object (of the class you wrote) for the current row. 2) Transfer the data in the row from the ResultSet to the object (using ResultSet.getXXX). 3) Add the object to the vector (using Vector.add).