O'Reilly logo

Sams Teach Yourself J2EE™ in 21 Days by Peter Roxburgh, Andy Longshaw, Debbie Law, Dan Haywood, Martin Bond

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

Q&A

Q1: Can a J2EE application be written without using any Enterprise JavaBeans?
A1: Certainly. You can write a client application that connects to a servlet in a Web container and have that servlet connect directly to a back-end database. You don't need to add an EJB. An EJB can add value by providing persistent conversational state if that is required. It can also provide transactional security and roll back to a previous state should there be an interruption in the flow of data for any reason. Therefore, you can use servlets and JSPs on their own if a database is simply read, but any updates or new records to be added will more safely be done using Enterprise JavaBeans.
Q2:What type of EJB should I typically use to encapsulate business logic? ...

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