background image

Creating the Bank Database Using Ant

<< Building the Duke Bank Example | Running Duke Bank Application >>
<< Building the Duke Bank Example | Running Duke Bank Application >>

Creating the Bank Database Using Ant

Creating the Bank Database Using Ant
In Duke's Bank, the database tables will be created and populated before deploying the
application. This happens automatically when you run the deploy task. You can manually reset
the database to its original state by following these steps:
1. In a terminal window or command prompt, go to the
tut-install/javaeetutorial5/examples/dukesbank/ directory.
2. Execute the following command:
ant create-tables
This task executes the SQL commands contained in
tut-install/javaeetutorial5/examples/common/sql/javadb/tutorial.sql. The SQL
commands delete any existing tables, create new tables, and insert the initial data in the tables.
Adding Users and Groups to the File Realm
To enable the Application Server to determine which users can access enterprise bean methods
and resources in the web client, add users and groups to the server's file security realm using the
Admin Console following the procedures described in
"Managing Users and Groups on the
Application Server" on page 781
. Add the users and groups listed in
Table 37­3
.
TABLE 37­3
Duke's Bank Users and Groups
User
Password
Group
200
javaee
bankCustomer
bankadmin
javaee
bankAdmin
Building, Packaging, and Deploying Duke's Bank
Using NetBeans IDE
Follow these instructions to build, package, deploy, and run the Duke's Bank example
application to your Application Server instance using NetBeans IDE.
1. In NetBeans IDE, select File
Open Project.
2. In the Open Project dialog, navigate to tut-install/javaeetutorial5/examples/.
3. Select the dukesbank folder.
4. Select the Open as Main Project and Open Required Projects check boxes.
5. Click Open Project Folder.
6. In the Projects tab, right-click the dukesbank project and select Deploy Project.
You will see the output in the Output tab.
Building, Packaging, Deploying, and Running the Duke's Bank Application
The Java EE 5 Tutorial · September 2007
1076