> I have a servlet that pulls demographic data rowsets (sorted > > alphabetically by 
>last name) from a database. [snip]
> when I pull out an Enumeration of the hashtable keys and then print > them out they 
>are not in the same order that I put them into the > hashtable!  I lose the alpha 
>sorting from the original rowsets.
        A hashtable will *not* keep the objects in any particular order.  If
ordering is important, you'll have to use either a Vector (BOO!) or an
array (Yea!).  There's probably things in the new Collections framework
that would  also work, but I'd recommend going with an array of a custom
defined type, especially if you're just iterating through the data to
print it out...  Very little overhead that way...
--
Within C++ is a smaller, cleaner language
struggling to get out.
It's called Java.

Thomas Moore
[EMAIL PROTECTED]        Home Account
Software.Engineer         [EMAIL PROTECTED]
phone://732.462.1880:268  NJ Patterns Group Home Page
employer://Celwave, RF    http://members.home.net/twmoore/cjpg

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to