I'm investigating options to create a database cache using HSQLDB in an in-memory mode. The idea is that the cache will be queried from a PHP application and the query will be passed to a Java application that runs the HSQLDB database.
Now, I've been thinking this through and I can't see any efficient way to pass the data from Java back to the PHP app. I know XML is an option, and so is JSON but i'm not sure if the additonal processing will be an overhead? Ideally I just want to pass an array of data back from the java to the php like what you would get with mysql_fetch_array or something.
I know it seems like a weird question, and probably seems completely illogical but i'm just exploring this option so please bare this in mind!