Java - MYSQL - save data | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Java - MYSQL - save data

I have this project where i have to change the "policies" of a market, and for the data to persist, i need to upload every change to mysql. But what if i dont need a table?. I just wanna save changes of the policy text of my jtxtarea. Or, can i, everytime i save my edited text of the txtArea upload it and remove the last one? I am really confused and need help, be free to ask any question because i may dis not explained it well.

22nd Jun 2020, 11:55 PM
Pame
Pame - avatar
2 Answers
+ 5
It depends on the requirements of the project. In some cases, each change must be preserved for audit purposes. Event sourcing takes this to an entirely different level whereby state can be reconstructed from a sequence of all events containing immutable data. Without knowing more details about the project, it's hard to say what is required in this case.
23rd Jun 2020, 1:00 AM
David Carroll
David Carroll - avatar
+ 1
If the task is to store it into a database, you should do so. It would be a useful feature to store it with a history in table (text, date, latest one is valid).
23rd Jun 2020, 12:32 AM
Sandra Meyer
Sandra Meyer - avatar