dwanders
asked on
beginning programming question
I am beginning to play with Java and the first application I would like to build will require storeing data inbetween program runs. I figure I could write to a text file, but I was wondering if there might be a better way to approach it? My plan is to have stored data that is read into an array or list at program start up then used while in the program. When I exit the program the data (and any new data added) is written back to the storage area. No being very familure with Java and wanting to learn, I am really looking more for guidance than anything.
Thanks
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can even use a Database to store the data, so to store and retrieve you can use the JDBC. In this manner you do not worry about serialization, etc. Only save and retrieve (the concurrence could be solved by Database itself; if you use file to save and restore, the concurrent access must be solved by your code).
Bye, Giant.
Bye, Giant.
ASKER
I will look into the above (serialization etc...), that database approch sounds interesting - In Visual Basic, I have been told it is pretty simple to add an Access database to a program as you data source - would this JDBC be the equivalent of that? If so - where can I find information about writting an app that has a small database (that is accessed only by the single program user - that gets packaged with the program itself) as a datasource?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
See here for examples:
http://www.javaalmanac.com/cgi-bin/search/find.pl?words=SQL
http://www.javaalmanac.com/cgi-bin/search/find.pl?words=SQL
for connecting access DB:
http://www.javaworld.com/javaworld/javaqa/2000-09/03-qa-0922-access.html
http://www.javaworld.com/javaworld/javaqa/2000-09/03-qa-0922-access.html
And here you can find the Java Tutorial:
http://java.sun.com/docs/books/tutorial/index.html
http://java.sun.com/docs/books/tutorial/jdbc/basics/
http://java.sun.com/docs/books/tutorial/index.html
http://java.sun.com/docs/books/tutorial/jdbc/basics/
I think a split could be done.
The asker give us no answer about what we suggest.
The asker give us no answer about what we suggest.
Thanks
CodingExperts