Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is it possible to save a HashMap in a Database

807569Jul 20 2006 — edited Jul 20 2006
Hi there,

I have this method which stores some actions that have change a text in a JTextPane
  private void createActionTable(JTextComponent textComponent) {
        actions = new HashMap();
        Action[] actionsArray = textComponent.getActions();
        for (int i = 0; i < actionsArray.length; i++) {
            Action a = actionsArray;
actions.put(a.getValue(Action.NAME), a);
}
}

this comes from the example provided from sun which is here

http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html

I want somehow to store the text changes in a database so when I open the program again to be able to load them and I don't how. I was thinking to store the HashMap above but I don't know if it is possible or if you have a better solution.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 17 2006
Added on Jul 20 2006
48 comments
1,711 views