File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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 RabbitMQ in Depth this week in the Open Source forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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: 9101

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.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Creating a flat file