"I'm not back." - Bill Harding, Twister
"I'm not back." - Bill Harding, Twister
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Ilja: In that case you could alternatively think about using a local in-memory database (such as hsql) as a cache. That way you wouldn't have to implement any complicated lookup logic.
I don't know what it is, -- some utility to map the db tables to memory? Does it work with the existing database, or is it a stand along thing?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Jim Yingst:
[QB]Are you always looking up a specific state, gender, and age? I might define a class combining state + gender into a single key (with equals() and hashCode() methods.
One thing that you maybe able to do is design a collection class that contains mulitple indexing schemes. In this case since you are looking for a range, I might suggest that you use a N-M tree for one of the indexes. Use that structure for age.
HTH
Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0672324261/ref=jranch-20" target="_blank" rel="nofollow">Ant Developer's Handbook</a>