0

I am designing a banking web application where i want to store some common data shared among users/sessions. I want to persist the data but don't have any options for using database or file system. Requirement is whenever common data is modified it should be visible to all instantaneously.I would appreciate some suggestions.

2
  • 3
    Where do you have the ability to store data ? Only in memory ? Commented Jan 4, 2013 at 9:06
  • 3
    "Persisting" means precissely storing the data in a filesystem (directly or through a database or other ways). Commented Jan 4, 2013 at 9:09

4 Answers 4

1

Try to use POJO. Then store all your POJO in a List or a Map.

e.g.

//this is your pojo public class User{ private String name; private int age; public void setName(String name){ this.name = name; } public String getName(){ return this.name; } public void setAge(int age){ this.age = age; } public int getAge(){ return this.age; } } public class TestUser{ public static void main(String args[]){ //to populate record, create object user User user1 = new User(); user1.setName = "name1"; user1.setAge = "20";//then so on //after creating object, store it in a <a href="http://tutorials.jenkov.com/java-collections/index.html"collection</a>. Depends on what you want. List<User> myList = new ArrayList<User>(); //then add it to your collection myList.add(user1); //and so on //you can access now your record on your list } } 
Sign up to request clarification or add additional context in comments.

Comments

1

you can use hsql db jdbc driver which has support for creating a in-memory database checkout hsql db documentation for in-memory db support

Comments

0

You can use cache like Memcached.

or you can use in-memory database like HSqlDB.

Comments

0

I would suggest you to use Caches (Oracle Coherence , simple Map) there are many option available. If you want to persist the data for permanently then i don't thing any other option than Database/Filesystem.

Caching

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.