What is a Data Access Object?
A Data Access Object, also known as a DAO, is a form of an object-oriented design pattern that allows you to separate data access from standard business logic within your application. Primarily, the DAO gives you the ability to perform updates and interactions with your database from a single file, your DAO file itself.
As we have seen in Chapter 3, the Bean objects hold values for a single record of data. The Data Access Objects work in harmony with the Bean objects and update a single record or row within a larger data store this could be an XML file, text file, or any other form of storage, but more commonly a database.
Note
Traditionally, Data Access Objects only ever deal with a single record at a time.
Traditionally, a DAO will contain four methods that allow you to do the following:
Create/insert a record
Read/select a record
Update a record
Delete a record
The 'big four' methods within a DAO are commonly referred to as CRUD methods (Create, Read, Update, and...