O'Reilly logo

Java™ Oracle® Database Development by David J. Gallardo

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 Sample Client Application

To begin, generate a sample client application using JDeveloper: Right-click on the UserInfo bean and select Create Sample Java Client. Select either Connect to OC4J embedded in JDeveloper or Connect to Remote App Server, depending on where you've deployed the EJB.

The first part of the file is standard, setting up the parameters (which would be in a properties file in production application) to obtain the initial JNDI context, then calling JNDI to obtain the home interface.

 package Samplemypackage4; import java.util.Hashtable; import javax.naming.Context; import javax.naming.InitialContext; import mypackage8.UserInfo; import mypackage8.UserInfoHome; import javax.ejb.FinderException; import javax.ejb.CreateException; ...

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