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

Get Java™ Oracle® Database Development 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.