This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
1. EJB is heavy weight and DAO is light weight. 2. If there is an absolute need for EJB (like sharing data, transactional, bean pooling), then EJB is a better choice. But just for the sake of DB access, don't go for EJB, instead you can use DAO (Data ACcess Object) 3. DAO is a pattern that embodies the typical JDBC code inside, and you can use it like plug-and-play mechanism, meaning that this would be a separate class file that can be called by your servlets/action classes or other classes which does the business logic. 4. Advantage is whenever you would like to for Entity Beans in future (espeically for CMP), then you can better use DAO, since DAO can be replaced with CMP (since CMP does not have any Database coding inside, only BMP has got) 5. This DAO can be treated separately; like it promotes the loose coupling; all database related coding (like change of DB, change of tables, change of schema...) could be done in DAO without affect the other parts.