Question

I received a requirement to build a small module within our system to read excel spreadsheets that user uploads to the system. I did some research, and a lot of people uses Apache POI or JExcel to read excel files. Both seem to be good API to build this small module.

The development team has built number of unit tests that use DBUnit to execute database-related test by reading test data recorded in excel files. Since, DBUnit has been proven to be a good API to read excel spreadsheet, I intend to use DBUnit in the small module that I have to develop, instead Apache POI.

However, I have never found anyone who uses DBUnit for any purposes other than unit test. Is it a good practice to use DBUnit to read excel spreadsheet in a system built using Java?

Was it helpful?

Solution

No, DBUnit operates on tables and will insert anything and everything passed into it. It would be a massive security hole to operate that way. Unless you trust your users with direct database access, otherwise this is a terrible idea.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top