As for unit testing DAOs, it is common to abstract away your data source into something that can be substituted by a humble object. This can be difficult when using jdbc, but not impossible. You basically would need a custom wrapper around the existing connection, statement, and result set classes that provide the thinnest interface your DAOs should use.