This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes BufferedWriter error   Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "BufferedWriter error   " Watch "BufferedWriter error   " New topic

BufferedWriter error

Amar Naik
Ranch Hand

Joined: Sep 26, 2003
Posts: 43
the output of SQL query is around 19254 rows. But my below code writes only 18700 lines to o/p file. Sometimes the o/p file as 18900 rows. No idea why the file write is having error. It does not even throw any exception
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
Anytime you write output to a file through a stream, make sure you close the stream when you are finished writing.
Amar Naik
Ranch Hand

Joined: Sep 26, 2003
Posts: 43
thanks. It solved the problem
I agree. Here's the link:
subject: BufferedWriter error
Similar Threads
Need Code Review
Memory issue with Result set
How to connect to mysql database?
Stored procedures in JDBC?
Determining null resultset