This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 8877
    
    8

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]
 
Consider Paul's rocket mass heater.
 
subject: How to create flate from Resultset?