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

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

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

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

1068<br />

Creating the Bank Database Using Ant<br />

In Duke’s Bank, the database tables will be created and populated before deploying the<br />

application. This happens automatically when you run the deploy task. You can manually reset<br />

the database to its original state by following these steps:<br />

1. In a terminal window or command prompt, go to the<br />

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

2. Execute the following command:<br />

ant create-tables<br />

This task executes the SQL commands contained in<br />

tut-install/javaeetutorial5/examples/common/sql/javadb/tutorial.sql. <strong>The</strong> SQL<br />

commands delete any existing tables, create new tables, and insert the initial data in the tables.<br />

Adding Users and Groups to the File Realm<br />

To enable the Application Server to determine which users can access enterprise bean methods<br />

and resources in the web client, add users and groups to the server’s file security realm using the<br />

Admin Console following the procedures described in “Managing Users and Groups on the<br />

Application Server” on page 779. Add the users and groups listed in Table 37–3.<br />

TABLE 37–3 Duke’s Bank Users and Groups<br />

User Password Group<br />

200 javaee bankCustomer<br />

bankadmin javaee bankAdmin<br />

Building, Packaging, and Deploying Duke’s Bank<br />

Using NetBeans IDE<br />

Follow these instructions to build, package, deploy, and run the Duke’s Bank example<br />

application to your Application Server instance using NetBeans IDE.<br />

1. In NetBeans IDE, select File→Open Project.<br />

2. In the Open Project dialog, navigate to tut-install/javaeetutorial5/examples/.<br />

3. Select the dukesbank folder.<br />

4. Select the Open as Main Project and Open Required Projects check boxes.<br />

5. Click Open Project.<br />

6. In the Projects tab, right-click the dukesbank project and select Undeploy and Deploy.<br />

You will see the output in the Output tab.<br />

<strong>The</strong> <strong>Java</strong> <strong>EE</strong> 5<strong>Tutorial</strong> • June 2010

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

Saved successfully!

Ooh no, something went wrong!