Fastest way to search large list

User will enter their account number into a web page. I then get a list from my database (will be about 100,000+ entries), and search to see if the account number is present, and forward to a new web page based on the results of the search.

Any thoughts on the fastest way to search a large list? The list has will have other data in it besides the account number.

My thoughts:

1. get the list

2. sort the list

3. use binary search?

List accountNumberList = getTheList();

Collections.sort(accountNumberList );

Message was edited by:

chet0264

[603 byte] By [chet0264a] at [2007-11-27 5:31:54]
# 1
The first thing that comes to mind is "you should learn some SQL".
Hippolytea at 2007-7-12 14:57:33 > top of Java-index,Java Essentials,Java Programming...
# 2
> The first thing that comes to mind is "you should> learn some SQL".Yeah. Don't retrieve 100,000 entries from the database when you only need 1. Learn how to write a sql statement to retrieve only the account number you want.
hunter9000a at 2007-7-12 14:57:33 > top of Java-index,Java Essentials,Java Programming...