File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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
Author

How to create flate from Resultset?

Jothi kannan
Greenhorn

Joined: Jun 06, 2008
Posts: 1
Team,
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
Bartender

Joined: Oct 29, 2001
Posts: 8935
    
    9

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
wood burning stoves
 
subject: How to create flate from Resultset?