Forums Register Login

How to do 'sql like' queries and joins on my java fields

+Pie Number of slices to send: Send
I'm wrapping up a major refactoring of a system which completely removes an un-needed database (legacy from a previous design) and moves state entirely in memory; which makes the entire system so much prettier! However, the largest resistance to moving away from the database for storing temporary/changing state was that they found it useful for debugging the system; the sql calls to query the all the tables essentially allowed them to view the entire state of the system quickly and easily. With the database gone I want to give them a similar method to view the in-memory state, much as they did with the database.

I can allow a user to send a command which writes my in-memory state, completely, to a human readable file for parsing. However; while the file wouldn't be *too* large (it all fits in memory easily), it would be large enough that without abilities to do joins and selects on the data contained it would be nearly impossible for someone to parse what's happening. I need a way to allow for doing these sort of joins/selects easily; preferable with minimal efforts.

A fancy method to allow me to do this while the data is in-memory would be awsome, but I don't nessesarily need that. If there exists some sort of open-source file that could, say, read in searlized objects and still allow some kind of select or parsing on them that woudl be great. Even an open source program which reads in data that is storeded as CSV (or xml or whatever) and does the same would work as well.

Can anyone suggest an API or program which would make this doable with minimal effort?
+Pie Number of slices to send: Send
A Google search for "sql like java toolkit" turns up some interesting hits.

For example the joSQL toolkit which claims:

JoSQL (SQL for Java Objects) provides the ability for a developer to apply a SQL statement to a collection of Java Objects. JoSQL provides the ability to search, order and group ANY Java objects and should be applied when you want to perform SQL-like queries on a collection of Java Objects.



Never underestimate the power of a Google query.

Bill
+Pie Number of slices to send: Send
oh I tried google quite a bit before hand. I kept getting information about toolkits that worked with sql (especially the 'LIKE' command of sql) instead. Of course I didn't think of adding 'toolkit' at the end; 'open source' hadn't worked lol.

Still thank you, I will look into this some more. In the meantime if anyone else has any suggestions that may be worth using. I really want the 'lowest effort' approch possible here; as I feel that with the other changes most of the 'benefit' they think they are getting from this approch will not be avialable so I don't want to waste too much time on providing this.

I am really okay with exporting stuff to a file and parsing what is in the file to provide the sql 'queries'; I need to be able to export state anyways to do a warm restart so that part exists in either case.

Anyways, off to look at this toolkit now; thank you again for the suggestion. I'll let you know rather or not it lokos like it will work.
+Pie Number of slices to send: Send
I looked into JoSQL. It won't do joins across differnt objects; which is an important part of what I need. Any other suggestions?
+Pie Number of slices to send: Send
If this is for offline debugging, export the data in a format importable into a database. Then just import it into whatever database you use and join away.
+Pie Number of slices to send: Send
 

drew sollenberger wrote:I looked into JoSQL. It won't do joins across differnt objects; which is an important part of what I need. Any other suggestions?



Create a new class of objects combining the searchable parts of your different objects with references back to the originals?

Bill
Is this the real life? Is this just fantasy? Is this a tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1304 times.
Similar Threads
IBM Exam 157 - Questions and Answers (Sample Exam)
My SCEA Part 1Study Notes
Database vs filesystem which one is best for storing images?
Why does Derby leave files on the hard drive?
pagination in jsp
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:23:54.