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

Session Beans Revisited

The case study for today has the same set of Session beans as yesterday, and their interfaces are the same. However, their implementation is quite different, because they delegate all database interactions to the Entity bean layer.

As an example, Listing 6.13 shows the original updateDetails() method in the stateful AdvertiseJob bean. The AdvertiseJob bean provides services for managing jobs.

Listing 6.13. AdvertiseJobBean.updateDetails() Without an Entity Bean Layer
 1: package agency; 2: 3: import java.util.*; 4: import javax.ejb.*; 5: import java.sql.*; 6: // imports omitted 7: 8: public class AdvertiseJobBean extends SessionBean 9: { 10: public void updateDetails(String description, String location, String[] skills) ...

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