Originally posted by miguel lisboa:
thanks again, but as for persisting to a text file, is that a poor idea?
Not necessarily.
It can be an advantage to have the persisted state stored in a human-readable, human-modifiable mode, or it can be a sever disadvantage. depends on the app.
If you're not persisting anything particular complex. I've written apps, that gather settings information and used java.util.Properties.store(), then on restart use load().
On the other hand, if you need to discourage user poking at the persisted state, or the state is complex or big and you don't want to read it and write it all at once, then using a database can be just thing.
Besides the well-known external databases, such as MySQL, Oracle, and Postgres, be aware that there are now also embeddable JDBC databases, such as HSQL. They're written in java and (can be configured to) run inside your application, thereby avoiding the complication of making program users configure a connection to a database (and possibly having to set one up).
Some people will try to "split the difference" and use an XML file for persistence. While it can work, and even work well, in my experience it's usually better to go with either plain text at one end of the spectrum, or a true database technology like JDBC at the other.