aspose file tools*
The moose likes Servlets and the fly likes is hashtable good to use? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "is hashtable good to use?" Watch "is hashtable good to use?" New topic
Author

is hashtable good to use?

Annette L'Heureux
Ranch Hand

Joined: Dec 07, 2000
Posts: 135
Just looking for some advice before I spend too much energy on something that's not worth doing.
I would like to use a hashtable to hold the results of a query to a database. I'm trying to populate a drop-down list with the results of that query, so what I would do is then loop through the hashtable and print out each entry into tags that would form my drop down list. Does that make sense?
Annette
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12781
    
    5
A Vector makes more sense because the order in a Hashtable is not predictable.
Bill
Annette L'Heureux
Ranch Hand

Joined: Dec 07, 2000
Posts: 135
A vector! Ok. I'll go do some research. I have no idea what a vector is.
Thanks!
Annette
Glen Tanner
Ranch Hand

Joined: Apr 16, 1999
Posts: 147

Vectors are not going to be supported very well by Sun in the future. Take a look at an ArrayList instead. An ArrayList is basically just an unsychronized Vector.
If you need verification that Vectors are indeed "old", take a look at "Using Vector in the Collection Framework" http://developer.java.sun.com/developer/TechTips/1999/tt0216.html#tip2
[This message has been edited by Glen Tanner (edited January 15, 2001).]
Annette L'Heureux
Ranch Hand

Joined: Dec 07, 2000
Posts: 135
Thanks Glen. I'll do that. Hopefully they are simple to use!
Glen Tanner
Ranch Hand

Joined: Apr 16, 1999
Posts: 147

Oh, by the way, Hashtable has gone the route of Vector. Sun recommends HashMap instead.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is hashtable good to use?