1

I have a very simple web project, which need to just persistence some "users", each one just have a few fields("username", "password").

Now I persistent them into a database, but I think it's too heavy.

I wonder if there are some easy ways to persistent them without a database. It's great just need to save pojos directly.


UPDATE

To save them in a file directly(like serialization, properties file) is easy, but not easy with CRUD. That means, when I get a specified user, I have to load them, then check the username one by one. When I update or delete one, I need to load all and save all.

I hope something like db4o, but with a good licence(not GPL nor commercial). The performance is not important here.

Freewind
  • 193,756
  • 157
  • 432
  • 708

2 Answers2

3

You could use the built-in serialization for Java or have a look at some of the XML serializers, like simple.

SQLite might be a suitable alternative to a client/server type database, but use from Java is a little awkward, as some native libs are required.

clstrfsck
  • 14,715
  • 4
  • 44
  • 59
0

Using Properties file is another solution, http://download.oracle.com/javase/tutorial/essential/environment/properties.html But note that you're storing passwords, you might need to encrypt them

thirdy
  • 612
  • 8
  • 18