This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Howto : maitain and update a table in memory

 
achana chan
Ranch Hand
Posts: 277
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
I've to create a table or an array list in memory, other applets will be writing to it and updating it. The records in the table will eventually be flushed to database.
Currently I am using String[] in an applet to hold these data, but everytime another applet calls this singleton, it flushes all the old data and start from scratch i.e. index at 0.
Can someone suggest some workable solution on how to create and update a table in memory please.
TIA :-)
 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you looked at the Collections classes in java.util? For example there is java.util.HashTable, java.util.HashSet (Which is a Hash Table implementation that uses a Set Interface) and java.util.HashMap (which is a hash table based implementation of the Map interface). Take a look at the Sun API or another resource on the Collection classes.
 
achana chan
Ranch Hand
Posts: 277
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope they allow multiple applets to update and insert into them without flushing the old data and resetting the index everytime an applet accesses it?
Thanks for the tip.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just curious ... how did you store your array in memory so that "other applets" can get to it? What does the code look like that gets a reference to the array? Maybe you're inadvertantly creating a new table every time through.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic