O'Reilly logo

J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software by Art Taylor

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

The MoviesBean JavaBean

The MoviesBean JavaBean (shown previously) is shown here again just to identify the portions of the class that pertain to the retrieval of entity beans.

The MoviesBean JavaBean
package movies.beans;

import java.rmi.*;
import javax.naming.*;
import javax.rmi.*;
import javax.ejb.*;
import java.util.*;

import db.*;
import movies.ejb.*;

public class MoviesBean extends MoviesVO {

private InitialContext context;

private MoviesEntityRemote movies;
private MoviesEntityHome   moviesHome;

public MoviesBean() {

try {
   Hashtable env = new Hashtable();

   //
   // get a connection to the EJB server (Jboss)
   //
   env.put( "java.naming.factory.initial",
					"org.jnp.interfaces.NamingContextFactory");
					env.put( "java.naming.provider.url", "jnp://localhost:1099"); ...

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