Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

I want to save changes to java execution  RSS feed

 
Ziyoda Mirkhonova
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
Sorry, I don't know how to explain it, but look:
I have a project with Main class, nice GUI and that must be as database. The problem is that, when I am making changes to that database, it does not store at all. For example, if I add 100 products to database, next time I execute it, there are no that 100 products in the database. It is uncomfortable for the user to enter products again and again...
I tried to do this:
and also, I tried to do save() method, but it is a waste of time...

But problem is, I never use object save from Properties class except to store only. I have ArrayList of Strings and integers and I have several classes with a lot of methods. This code does not give me what I want.

Can you help me, please!!!
Do you know some other methods to store changes?
Thanks a lot!
[ April 29, 2006: Message edited by: Ziyoda Mirkhonova ]
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens excatly? Does the file get created and is empty? Or does the file not get created at all? You don't have a file called "Main.java" by any chance, do you? Because it might get overwritten by your code (or maybe the saving wouldn't work, I'm not sure).

A simple example of writing properties to disk can be found here.
 
Ziyoda Mirkhonova
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf Dittmer,
No, no any file is created in main, it's just a project with 5 java source files and most methods are static here. I don't know how to get one file created and saved. Is there any other option instead of creating text file Main and saving all transactions there? I am afraid, it may get complicated to program...
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try the code that I linked to?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!