title: How to apply unit test on DAOs in java
body: <p>I don't know how to apply unit tests on data access layer. I always wonder if the data access layer should be tested. In my company, we have stable database to store unit test data and test data access layer by running data access objects and check the data they get from the stable database. </p>
  
  <p>In order to pass the unit tests, data in the stable database can not be modified anymore. I think there is a better solution to this. If I am not mistaken, the the mock object cannot perform tests on SQL statements and <code>ResultSet</code> mappings.</p>
  
  <p>What is the best way to unit test the DAO? Is there a better way to do this with TDD?</p>