File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and the fly likes Creating a flat file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Creating a flat file" Watch "Creating a flat file" New topic

Creating a flat file

Al Kaiser
Ranch Hand

Joined: Nov 20, 2003
Posts: 35
How can I create a flat file as opposed to database and use that file to store and retrieve information?
Joe Ess

Joined: Oct 29, 2001
Posts: 8702

That can be as simple as writing out your data as a text or binary file. If you want to get fancy or read the data in Excel you could use comma or tabs to seperate the fields. You can get as complex as you want. I've used RandomAccessFile to store data in fixed records and used an "id" which was the offset of the record in the file. Makes for very fast access.

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Creating a flat file
Similar Threads
In this Developer assignment database Flat file
The earth
Which design pattern to use ?
trying to use a txt file like a database
WA #1.....word association