You will now run the application and generate a sample client for testing purposes.
To run the application:
- In the Navigator, right-click your session bean (hrApp)
and choose Run hrApp from the context menu.
As you did previously, you'll use the sample Java client to test the application.
To create and run a sample client:
- In the Navigator, right click on your session bean (hrApp)
and choose New Sample Java Client.
- In the Sample EJB Java Client Details dialog, select the default option
for Connect to OC4J Embedded in JDeveloper and
click OK.
A new file, hrAppClient1.java appears in the Navigator
and opens in the Code Editor.
- Underneath the create() method, call
listDepartments() with
the following code:
System.out.println( HrApp.listDepartments( ));
- Run the application by selecting Run | Run
hrAppClient1.java
- You should see a list of department numbers, department names, and locations
in the Log Window.