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"); ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.