To mimic ResultSet, which one offers better performance -
An ArrayList of ArrayLists OR
A single ArrayList OR
Something else ?
I am trying to mimic the jdbc ResultSet using ArrayList of ArrayLists. i.e. Each of the ResultSet row becomes an ArrayList with column values populated in it. All these ArrayLists (each representing a row) is stuffed into another ArrayList (which acts similar to a ResultSet object)
An another approach is to have a single ArrayList with column values populated into it one row after the other. i.e. The first row column values will be populated first, followed by the second row & so on.
I would like to know when thousands of records are retrieved, which one of the above two offers maximum performance. Would anyone suggest any other data structure other than the ones above to mimic the ResultSet. My primary concern is performance in terms of speed, memory, etc etc
Thanks in advance
Alex
An ArrayList of ArrayLists OR
A single ArrayList OR
Something else ?
I am trying to mimic the jdbc ResultSet using ArrayList of ArrayLists. i.e. Each of the ResultSet row becomes an ArrayList with column values populated in it. All these ArrayLists (each representing a row) is stuffed into another ArrayList (which acts similar to a ResultSet object)
An another approach is to have a single ArrayList with column values populated into it one row after the other. i.e. The first row column values will be populated first, followed by the second row & so on.
I would like to know when thousands of records are retrieved, which one of the above two offers maximum performance. Would anyone suggest any other data structure other than the ones above to mimic the ResultSet. My primary concern is performance in terms of speed, memory, etc etc
Thanks in advance
Alex