which collection to use...

I 've a resultset table from database as follows -

COUNT -- SSN --  ID -- LASTNAME -- FIRSTNAME --  APPLYTERM -- ENTERING_STATUS --  PART_FULL_STATUS -- PROGRAMCODE -- EMAIL --  HOME_PHONE -- STATUS
7---111111111---223---yang---yiping---2005S---F---F---NKCCSCS  BS---yy32@njit.edu---<NULL>---c---
7---111111111---193---wong---siu---2006S---F---F---<NULL>---wong@njit.edu---<NULL>---c---
7---111111111---370---kumar---Jagadeesh---2006S---F---F---NKARCARCHBAR---jm337@njit.edu---<NULL>---p---
7---111111111---159---xi---zhouzhou---2005S---R---F---NKSLASTS BS---yy32@njit.edu---<NULL>---p---
2---123111111---359---Motamarri---jagadeesh---2006S---F---F---NKCCSCS  BS---jm337@njit.edu---<NULL>---c---
4---123121234---369---Motamarri---Jagadeesh---2006S---F---F---NKSLAEVSCBS---jm337@njit.edu---<NULL>---p---
2---137156075---299---nash---john---2006S---T---F---NKNCEMNETBET---yy32@njit.edu---<NULL>---c---


I need to put them in a collection say ....hashmap or treemap or whatever that does not change this order of rows...

and retrieve them in the same way....

can an y body help me with the code... java && jsp


i mean i need to put and retrieve in jsp

thank you.
LVL 10
jagadeesh_motamarriAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
You can make a List of List or save a List of 'Person' beans
0
jagadeesh_motamarriAuthor Commented:
I like the idea of vector into a list....and retrive it


and can anyone provide me sample code...for the same
0
mrigankCommented:
LinkedList will the collection that will not change the Order.
In case of Maps, LinkedHashMap will preserve the Order in which the data is enterred.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

CEHJCommented:
:-)

You need a *nested* collection
0
jagadeesh_motamarriAuthor Commented:
Yea i was able to figure it out.

I used Vector of ArrayList.


Thankz though
0
CEHJCommented:
>>I used Vector of ArrayList.

ArrayList of ArrayList would probably be better
0
jagadeesh_motamarriAuthor Commented:
Actually the module thatz existing is written using TreeMap and Vectors....since the TreeMap is a sorted one, the results are not the one that i'm putting into vector....so i need something  to hold the values as they are inserted...so i felt arraylist of vector to be one option.

using arraylist i was able to wrap up just by changing few lines of code....

thankz
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.