• Post Reply Bookmark Topic Watch Topic
  • New Topic

Fail-safe table application  RSS feed

 
Tim Gruentaler
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This is my first post here!
I'm making an application with a table in it. The values I enter in the table cells are being computed and the result entered in the last cell. Then the rows are ordered by that cell and the first 20 rows printed.
The thing is: I have to enter many rows...and if anything fails in the process - the application crashes, OS crashes...or the app just being closed, I loose the data.

So...is there any way to save the data into a database by pressing a button, or any other way (the easier the better), so that it's just there the next time i open it, or load it in somehow?

Any advice, code or links would be greatly appreciated!

I have the feeling that this question is really dumb, but everybody is a beginner at some point...
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a desktop application using Swing, and the table a JTable? You could attach listeners to the table cells so that every 10 cells (or so) that you enter data into all data gets saved. Maybe a local file would work best for that. At application startup you would check whether such a file exists, and load it if it does.
 
Campbell Ritchie
Marshal
Posts: 56533
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch

As for databases, I presume you have been through the section in the Java Tutorials? It is very helpful.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!