File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes I/O and Streams and the fly likes How to create flate from Resultset? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How to create flate from Resultset?" Watch "How to create flate from Resultset?" New topic

How to create flate from Resultset?

Jothi kannan

Joined: Jun 06, 2008
Posts: 1
I have resultset of size of 50000 records, I need to wite to flat file, I am using I/O objects like follows:
outPW_FlatFile = new PrintWriter(bufferedOutputStream(out_FlatFile), true);

I am getting outof mememry exception. what is the optimal ways to create the flat file?
Joe Ess

Joined: Oct 29, 2001
Posts: 9126

Welcome to the JavaRanch.
Rather than read in all 50000 records then writing them to a file, try reading a subset of the result set, 1 or 1000, and write that block to the file.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: How to create flate from Resultset?
It's not a secret anymore!