• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is hashtable good to use?

 
Annette L'Heureux
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Vector makes more sense because the order in a Hashtable is not predictable.
Bill
 
Annette L'Heureux
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A vector! Ok. I'll go do some research. I have no idea what a vector is.
Thanks!
Annette
 
Glen Tanner
Ranch Hand
Posts: 147
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Glen. I'll do that. Hopefully they are simple to use!
 
Glen Tanner
Ranch Hand
Posts: 147
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, by the way, Hashtable has gone the route of Vector. Sun recommends HashMap instead.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic