문제

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

도움이 되었습니까?

해결책

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"?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top