How can I store large amount of data from a database to XML (memory problem)?

前端 未结 4 662
情书的邮戳
情书的邮戳 2021-02-09 02:18

First, I had a problem with getting the data from the Database, it took too much memory and failed. I\'ve set -Xmx1500M and I\'m using scrolling ResultSet so that was taken care

4条回答
  •  南方客
    南方客 (楼主)
    2021-02-09 02:47

    You are assembling the complete file in memory: what you should be doing is writing the data directly to the file.

    Additionally, you might consider using a proper XML API rather than assembling XML as a text file. A short tutorial is available here.

提交回复
热议问题