red51 : Danke für deine Antwort. Wie kann man ein byte[] in eine Datenbank speichern?
yahwho : Thank you, too, for your answer. English is not a problem for me.
I know that you can save each statement individually in the database, including details.
The only thing I have to worry about is the amount that is then written to the database. So that there is not so much communication with the database, everything is saved in variables when the server is started. All calculations are then made there. When a period of time has passed, or a player leaves the server, or the server shuts down, the database will be updated with the variables.
It's just easier to overwrite a blob than it is to go through a list.
Let's get back to the crowd:
Let's assume there are around 30 people playing on the server. Every time a player wants to deposit or withdraw something from the bank, a statement is created so that one can later see what happened at the bank with one command. It can happen that a player is offline. This player offers something for sale on the server. He connected his shop to the bank. Later, when we are back online, the player wants to know if he has sold something. He can now look up this in the statement. This player doesn't just sell one object, but maybe 30. And of these 30 objects, he made stacks of 10, which are all sold individually. 30 x 10 = 300. This means that 300 bank transactions can take place in this shop.
Unfortunately it's not just one player on the server, but 30. Anyone from then could open a shop.
Now if everyone sells 300 items, that's: 300 x 30 = 9,000 bank transactions.
So that's 9,000 statements.
But now there is the greatest of all:
What if everyone has now paid not with cash but with the bank?
Then I have to double everything again, there is a statement for paying out and a statement for paying in.
That is then 18,000 statements. etc.
And that, if things go wrong, everything could happen in one day.
That's why I chose Blob. I can tell an ArrayList that it should only display the last 50 statements.
I don't have to compare what is already in the list and what is new with the list in the database.
It is simply overwritten.