data structure similar to database table

i have the need for a data structure that will essentially be the same as a database table. this "table" can be queried against and sorted.

currently, i am using an interface to abstract this "table" datastructure, and implementing the interface via jdbc calls.

may someone point me in the right direction?

in .NET, they have the DataTable and DataSet data structures, which do exactly as i require. These are objects essentially correspond to a database table and database, respectively. They are used as in-memory database.

i have already tried using HSQL, but was wondering if there was a "better" way (i.e. more light-weight, intuitive, easier to use).

thanks.

[702 byte] By [jakestera] at [2007-10-3 9:34:19]
# 1

Use an array and put your records in it.

Efficient querying (simple queries) requires you to build indices for each element you wish to query on. The type of index depends on the kind on search you want to perform. Exact matches can use Hashes. Sorting, prefix or postfix matching can be performed using various tree indices.

Complex queries (i.e. those that query on multiple parameters generally require query optimisers to figure out how to use the indies you have in the most efficient manner possible (well as close as the optimizer can get to it).

cheers

matfud

matfuda at 2007-7-15 4:49:37 > top of Java-index,Other Topics,Algorithms...