Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question