• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Advise On Flat File

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Susilo Saja
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1211
Mac IntelliJ IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And how do you plan to run the 'Swing' application without installing Java?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Susilo Saja
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah I guess it's not so hard anyway to install Java.
Thanks guys!

Regards,
Susilo
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic