I googled for something and (fortunately) hit upon
this. They claim that this library enables querying objects in a collection using a syntax similar to SQL syntax. I tried a few examples and found it living upto the claim. There is another similar open source product from Apache by name JXPath, that uses XPATH syntax instead of SQL. Hmmmm.. some pabulum (atlast!)