10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

After the customer has been authenticated, the identifier provided by the customer is used as a<br />

key to identify the customer’s accounts. <strong>The</strong> identifier is retrieved from the FacesContext<br />

object by the CustomerBean constructor, which saves it into the customerId property:<br />

customerId = Long.parseLong(FacesContext.getCurrentInstance()<br />

.getExternalContext().getUserPrincipal().getName());<br />

Building, Packaging, Deploying, and Running the Duke's Bank<br />

Application<br />

To build the Duke’s Bank application, you must have installed the tutorial bundle as described<br />

in . When you install the bundle, the Duke’s Bank application files are located in the<br />

tut-install/javaeetutorial5/examples/dukesbank/ directory. This directory contains the<br />

configuration files for creating the EAR, dukesbank.ear. <strong>The</strong> EAR consists of the following<br />

three modules:<br />

■ dukesbank-appclient: <strong>The</strong> application client<br />

■ dukesbank-ejb: <strong>The</strong> enterprise beans and persistence entities<br />

■ dukesbank-war: <strong>The</strong> web client<br />

After you build the source code, all the sub-modules will be built into their respective module<br />

packages, and the resulting EAR file will reside in the<br />

tut-install/javaeetutorial5/examples/dukesbank/dist/ directory.<br />

Setting Up the Servers<br />

Before you can package, deploy, and run the example, you must first set up the <strong>Java</strong> DB database<br />

server with customer and account data, and you must add some resources to the Application<br />

Server.<br />

Starting the Application Server<br />

Before you can start this tutorial, the Application Server must be running. For information on<br />

starting the Application Server, see “Starting and Stopping the Application Server” on page 68.<br />

Creating the Bank Database in NetBeans IDE<br />

Building, Packaging, Deploying, and Running the Duke's Bank Application<br />

To create the database tables used in Duke’s Bank, follow the instructions in “Creating the<br />

Database Tables in NetBeans IDE” on page 720.<br />

Chapter 37 • <strong>The</strong> Duke’s Bank Application 1067

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

Saved successfully!

Ooh no, something went wrong!