Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disk storage in a Java EE application

I have Java EE app in which I want to small little amount of data to disk, eg just user/passwords.

I dont want to go through the hassle of integrating with a full db for this little amount of data.

Is there a standard way to access the file system and a standard folder where web applications can store their data on disk, other than using a database?

Note:

I am not using EJBs. It's a web application using Servlets.

like image 682
pdeva Avatar asked Jun 05 '11 11:06

pdeva


2 Answers

You could consider using the preferences API to store this data - it's available on Java EE as well.

like image 154
Michael Borgwardt Avatar answered Sep 20 '22 09:09

Michael Borgwardt


Use a simple Java based database, like HSqlDB or h2. The setup won't be that complicated compared to a heavyweight DB. The key advantage this will give you is managing concurrent updates, which you would have to code yourself if you use direct file access.

like image 22
artbristol Avatar answered Sep 18 '22 09:09

artbristol