O'Reilly logo

Enterprise JavaBeans™ Component Architecture: Designing and Coding Enterprise Applications by Paul Anderson, Gail Anderson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.5. Data Access Object Pattern

The Music EJB shown in this chapter accesses a database using the JDBC's SQL interface. It works fine with Cloudscape's reference implementation of SQL (provided by Sun's J2EE reference implementation) but what happens if we change databases? How would this affect our code? Unfortunately, porting the current version of the Music EJB to a different database is not as smooth as one would like. Specifically, changes may be necessary to the bean implementation class, MusicBean.java. Although we isolated database access to separate private methods in the Music EJB, the EJB code must still be recompiled and redeployed.

The Data Access Object (DAO) pattern introduces a deeper level of abstraction for any EJB that accesses ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required