Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to save data temporarily on runtime of java GUI application without having any database functionality?

I want to make a library management system in which I want to store book name and book ID etc. But I am restricted not to use the database functionality and save that data only during the time of execution.

How could I go about this?

like image 443
Adnan Najeeb Avatar asked Jan 02 '23 10:01

Adnan Najeeb


2 Answers

Your options are straight forward:

  • keep that data in memory
  • use a temporary file in the file system
  • connect to some remote service where your app stores data (and then you are free to use whatever persistence mechanism you like to use)
like image 76
GhostCat Avatar answered Jan 13 '23 17:01

GhostCat


Some type of storage medium needs to be decided on. There are a couple choices you can use. You can store the data as property files, xml or json.

There are tools like Jackson that can serialize and deserialize objects to json files and POJOs respectively to make persistence easier. There are also tools for xml and property file as well.

like image 43
locus2k Avatar answered Jan 13 '23 15:01

locus2k