Dear Christian, Thank you very much for your answer. I have tried to use input and output streams but I could not pipeline the input stream to an output stream. I have to explicitly create an output stream ByteArrayOutputStream out = new ByteArrayOutputStream(); new XQuery(inputQuery).execute(context, out); InputStream in = new ByteArrayInputStream(out.toByteArray()); then I store it to an xml file in my database: session.execute("open " + Constants.DB); session.add(fileName, in); Could you tell me and/or give me the links to the instructions of pipelining the output stream to a database file? Thank you very much. Huy -- Huy Vu Oxford University, United Kingdom http://www.cs.ox.ac.uk/people/huy.vu/ On 18 Dec 2011, at 10:52, BaseX Support wrote:
Dear Huy,
have you looked at the Session classes (LocalSession/ClientSession)? These classes supports input and output streams to do pipelining, such as querying results and sending them to another target without first materializing all data.
Hope this helps, Christian
On Sun, Dec 18, 2011 at 10:27 AM, Huy Vu <qhuyvu@gmail.com> wrote:
Hello,
I am writing my code in Java and the result after querying xml files in my BaseX database is very large, about 500MB. Thus, I would like to stream the output to another xml file in the BaseX database. Could you tell me how to do this?
Many thanks,
Huy Vu
-- Huy Vu Oxford University, United Kingdom http://www.cs.ox.ac.uk/people/huy.vu/