What is the best way to test your sql statements? In our case, a lot depends on the state of the db, before the junit test is run, for it to pass. Is there a standard way of using junit/cactus for testing sql statements? Thanks...
You can use dbUnit for setting up the database schema before running the JUnit TestCase, and then assert that the query returned what is expected or that the expected updates were made into the database.