File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring 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
It's not a secret anymore!