Java Reference
In-Depth Information
You can verify the populated Author table as illustrated in Figure 1-18 .
Figure 1-18. All authors in the Author table
Data Access Layer for the Bookstore Application
Now that the database is ready, you will build the data access layer for application. The data
access layer will retrieve the data via JDBC from the database and directly map the result set
into Java objects. These Java objects are the domain objects in the application that are the Java
representation of the tables in the database. The data access layer is responsible for interfacing with
the underlying persistence mechanism in a transparent way in order to store and retrieve objects
from the database. This transparency means that the data access layer can switch the persistence
mechanism from plain JDBC 14 to ORM 15 persistence technologies such as Hibernate, 16 JPA, 17 and so
on, without affecting the client of the data access layer. This transparency is achieved via the data
access object (DAO) pattern, as illustrated in Figure 1-19 . The DAO object provides an interface to the
database or the underlying persistence mechanism, thus abstracting the underlying implementation
from the client.
Figure 1-19. DAO pattern
www.oracle.com/technetwork/java/overview-141217.html
14
http://en.wikipedia.org/wiki/Object-relational_mapping
15
www.hibernate.org/
16
www.oracle.com/technetwork/java/javaee/tech/persistence-jsp-140049.html
17
 
Search WWH ::




Custom Search