Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Suggestion on what container to use

Status
Not open for further replies.

dcusick

Technical User
Aug 9, 2000
271
US
Hi all... I have a question about what type of container I should use for a project I'm working on.. Basically, I am grabbing data from a database for use on a webpage. There is a varying list of application names, and each application could have multiple versions. If I did a SELECT DISTINCT on the table I would get output similar to the following...

App Name Version
-------- -------
App1 1
App1 2
App2 1
App3 5
App3 4

I want to have this data in one container. Basically I want to be able to print out all of the distinct app names as well as the distinct version numbers. I need an easy way to iterate though this list. Basically, I want to look up App1, and print 1,2. Look up App2, and print 1. Any ideas on how this can be done? Any help would be greatly appreciated. Thanks.

Doug
 
if you're not doing a lot of insertion/deletion, consider ArrayList. In 1.4, ArrayList is fast because it implements the marker Interface called randomAccess.

If you need a synch. list, then consider using Vector. It also implements that interface.

then check out this thread on how to use iterator

thread269-590793

~za~
You can't bring back a dead thread!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top