16.10.2015 Views

Getting Started with WebSphere Application Server

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 5 – Enterprise Java Beans 107<br />

9. Deploy and Run<br />

Finally, deploy the ejb-studentear project into the Community Edition server. Insert<br />

some sample data into the Student table, and then invoke the servlet<br />

StudentCreditCalculator <strong>with</strong> the URL below.<br />

http://localhost:8080/ejb-studentweb/StudentCreditCalculator.<br />

The result will look as shown in Figure 5.8.<br />

Figure 5.8 - Invoking the StudentCreditCalculator servlet<br />

5.7 Review questions<br />

1. What is the URL to use when you query an EJB using JNDI?<br />

2. What are the default names for an EJB local interface and remote interface?<br />

3. What is the typical procedure to use an EJB in a servlet?<br />

4. What is the typical procedure to use an EJB in an application client?<br />

5. What is the typical procedure to create JPA entities from tables?<br />

6. Which are the annotations used for EJB 3.0?<br />

A. @EJB<br />

B. @Remote<br />

C. @Local<br />

D. @Servlet<br />

E. @JSP<br />

F. @Null<br />

7. Which are the annotations used for JPA?<br />

A. @Entities

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!