• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

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.
0
jagadeesh_motamarri
Asked:
jagadeesh_motamarri
  • 3
  • 3
2 Solutions
 
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now