A
A
Armitage892015-11-22 21:25:22
Java
Armitage89, 2015-11-22 21:25:22

How to store program data?

There is a question of storing program data. As an example of a task, I decided to take the same alarm clock, tobish data will be, in an estimate, the start time, some hint text, whether the alarm is "active" ... and perhaps that's enough, and that's not the point.
Since I am a beginner in practical implementation, I was interested in the question "but how, in general, is it better to keep data" - to unload the entire set of alarm clock objects as a container, each time overwriting the file, or is there a more correct way to make the storage in the form of a text file, where to add (although I did not understand how to do it correctly without overwriting the file) "edits".
Or is there another, more tailored to the task, solution for such tasks?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nirvimel, 2015-11-22
@Armitage89

DBMS, for example H2 (if it's java), or any one you like.

A
Andrey Shishkin, 2015-11-23
@compiler

If the amount of data you have is limited to just one entry: "time, hint, status", then the easiest way is to file the config file and store it there. If there is more than one alarm clock, plus you want to store some more data besides these, then it is already advisable to connect a DBMS. Embeded option, the same H2 is very convenient in this regard. However, it has already been recommended to you :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question