Question: how dao works in java?
Answer: Overview. The Data Access Object (DAO) pattern is a structural pattern that allows us to isolate the application/business layer from the persistence layer (usually a relational database, but it could be any other persistence mechanism) using an abstract API. ... 
A Simple Implementation. ... 
Using the Pattern With JPA. ... 
Conclusion.