aspose file tools*
The moose likes JDBC and the fly likes Advise On Flat File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Advise On Flat File" Watch "Advise On Flat File" New topic
Author

Advise On Flat File

Susilo Saja
Ranch Hand

Joined: May 27, 2003
Posts: 91
Hi,

I'm thinking of using flat file as database.
But I don't know how good it is.

Can someone point me a reference to a good API in accessing flat file?
What type of file is good for this?
Can I do stuff similar to "select", "update", "insert", or "delete" ?

Regards,
Susilo
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42273
    
  64
Instead of trying to re-invent the wheel, have you looked at databases like HSQLDB (on SourceForge), which also store data in human-readable text files, but have the benefit of using JDBC?


Ping & DNS - my free Android networking tools app
Susilo Saja
Ranch Hand

Joined: May 27, 2003
Posts: 91
Hi,

Thanks for the reply. I've tried to look at hsqldb, and the problem for me is that we have to install java in order to use it.

I prefer not to have to install Java, because I am going to deploy my application (swing application) on a lot of client. I prefer an one-click install to deploy it, while if using hsqldb, my prediction is that it's gonna take more effort. That's why I'm thinking of using flat-file, because we don't have to install any database engine. Please correct me if I'm wrong.

Regards,
Susilo
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

And how do you plan to run the 'Swing' application without installing Java?


The future is here. It's just not evenly distributed yet. - William Gibson
Consultant @ Xebia. Sonny Gill Tweets
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14268
    
  21

The whole idea of HSQLDB is that it is a small, simple, pure Java database, that you can embed in your application. You only need to include the HSQLDB JAR file or classes into your own application. You do not need to install it separately from your application.

And ofcourse, if you're writing a Swing application, your clients must have Java installed anyway, otherwise they will not be able to run it.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Susilo Saja
Ranch Hand

Joined: May 27, 2003
Posts: 91
If I only need to include the jar file to use hsqldb, that is much better.
Do I need to start the service like the other database?
Can it be called by client from another pc ?

I am planning to convert my application to exe, maybe using exe4j.
I haven't do a lot of experiment, but my prediction is that I don't have to install jre to run the exe.
That's why I try to avoid having to install jre at all.

Regards,
Susilo
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42273
    
  64
As Sonny and Jesper pointed out, you mentioned that you wanted this to be a Swing application. Swing needs Java -that means, at least the JRE- to be installed. So you don't need to install it again to run a pure-Java database.

HSQLDB in particular has several ways you can run it in. Either in-process in an application, or as a server, which would then be accessible to clients on other machines as well.

After a quick look at exe4j, it seems that it simply packages a Java application in a Windows executable. It does not remove the need for a JRE (although it does seem to have the option of installing one for you, if it can't find one). Either way, somehow there will need to be a JRE, so a Java database would not make your setup any more complicated.
[ August 25, 2005: Message edited by: Ulf Dittmer ]
Susilo Saja
Ranch Hand

Joined: May 27, 2003
Posts: 91
Yeah I guess it's not so hard anyway to install Java.
Thanks guys!

Regards,
Susilo
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Advise On Flat File