hello,
i'm wondering if anybody can point me to an example how to stream the
resultset (containing XML) to a SAXParser ? the query gets returned
with: "FOR XML RAW" so the xml is broken up into multiple records.
for example:
record1:
<row UNIQUEID="53380601" a="53" /> (.... heaps more of these records
...)<row UNIQUEID="5311111"
record2:
a="125" /> <row UNIQUEID="5660101" a="165" />
and i can't seem to figure out how to combine the records together in
a streaming way (i know i can just collect the complete xml by
appending them to a StringBuffer, but that might get realy realy big)
any idea's are very welcome.
regards,
tom
Mikhail Danilov - 28 Oct 2004 08:52 GMT
> hello,
>
> i'm wondering if anybody can point me to an example how to stream the
> resultset (containing XML) to a SAXParser ? the query gets returned
> with: "FOR XML RAW" so the xml is broken up into multiple records.
Hello,
You can use ByteArrayStream.
For example, you receive at the start the total lenght of data, after this
you store received data in byte array. Then all data is received you can
create ByteArrayStream and translate it to SAXParser...
Regards, Michael