views:

51

answers:

1

Hello, I have a application that will be run offline so there is no database connection. My options for the data-source are Excel Spreedsheet, CSV, or XML files.

The application needs to be able to search for a record and update it. What's the best way to do this?

  1. Should I load the entire spreadsheet into memory and then work with it in memory (cache)? It sounds efficient, but risky.

  2. Should I do a scan each time and then update each time, it sounds like an xml file would work best for this

+1  A: 

Xml is really nice for such tasks...you can parse it easily and modify it. If you need more logic you can use Apache Digester. But it is more made for small xml Files. You can create Java Objects out of the XML structure.

Hope this helps.

Edit: One thing i like to add...that the "new" .docx Type for Documents is already an XML Folder. So working/modifying Excel Sheets got easier. They use it for Exel Sheets too..not sure about the type name..something like ".xlsx"?

bastianneu
Thanks, so I'll have the user export the data to xml or my system will email them the xml file.Then when they are disconnected the win forms app will use that xml file.
aron
Just a small hint...the new docx Document Type is already an XML container.
bastianneu