database on the fly?

Hello,

I am looking for an efficient collection of java classes which construct sort of a "database" on the fly - so that I could make queries and iterate through objects according to a certain cut (I don't mind if I need to specify the kind of cuts ahead as long as I can dynamically add objects and the cuts will be updated accordingly).

So, for example, if I have objects of the form

class UserName

{

public:

String userName;

}

I would like to have a quick index for all users which their names contain a certain string (this was just a simple example).

I looked around and found trove, but I don't think it can do such things.

Any ideas? Basically, I am looking for "a database on the fly" where you can query for objects using "semi-SELECT" stataements.

Speed and memory are the most important issues for me here...

I am using Linux.

Thanks,

Jerr.

[946 byte] By [jerra] at [2007-11-27 4:28:15]
# 1
huh i remember this post somewhere else...hashmap tried?thanks
geomana at 2007-7-12 9:36:58 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
so you want a database constructed in memory?
alancola at 2007-7-12 9:36:58 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...