The problem is this: you have a SQL database, some stored procedures, and a layer of code sitting between your application and the database. How can you put tests in place to make sure your code really is reading and writing the right data from the database?
The Dbunit Framework is a JUnit extension (also usable from Ant) targeted for database-driven projects that, among other things, puts your database into a known state between test runs. This is an excellent way to avoid the myriad of problems that can occur when one test case corrupts the database and causes subsequent tests to fail or exacerbate the damage.
DbUnit has the ability to export and import your database (or specified tables) content to and from XML datasets. This is targeted for functional testing, so this is not the perfect tool to backup a huge production database.
DbUnit also provides assert facility to verify that your database content match some expected values.
Guides on how to use DBunit with Junit can be found here

Recent comments
15 hours 25 min ago
15 hours 30 min ago
2 years 8 weeks ago
2 years 8 weeks ago
2 years 10 weeks ago
2 years 11 weeks ago
2 years 11 weeks ago
2 years 20 weeks ago
2 years 20 weeks ago
2 years 21 weeks ago