This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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 :-)
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.
Joined: Jul 29, 2002
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.
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.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi