wood burning stoves*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 8836
    
    7

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]
 
 
subject: How to create flate from Resultset?
 
Similar Threads
problem with "group by"
Creating a flat file
Problem facing with FlatFIle adapter in websphere integration developer7.0
My Data over The network
UNIX - JAVA database or random access