This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes Reading very large file 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 "Reading very large file" Watch "Reading very large file" New topic

Reading very large file

Prakash Dwivedi
Ranch Hand

Joined: Sep 28, 2002
Posts: 452
Hello Friends,
I have to make a java program which reads data from a text file(about 10 mb in size), and than inserts that data into the database. Can i somehow make my code run faster?,
is java.nio.* faster than* ?
should i try using it?

plz advice

Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Wander Mariano

Joined: Apr 08, 2003
Posts: 1
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
On the database side - not exactly what you asked about - look into batching your insert statements. The Statement interface has a couple methods to do with batching. Best of luck!

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I agree. Here's the link:
subject: Reading very large file
Similar Threads
Loosing Object-Oriented Design points - URLyBird
Comparison of data types
August 25 Version of Dan Chisholm's Exam
Repaint and Mouse Motion
Lots of .nfs files being created