Sun Logo


Sun ONE Studio 4, Enterprise Edition for Java Tutorial

816-7860-10



Contents

Before You Begin

1. Getting Started

Software Requirements for the Tutorial

Requirements for IDE-to-Application Server Communication

Software Requirements

Installation Options

Installing the Oracle Type 4 Driver in the IDE and the Application Server

Starting the Software

Installing the Application Server Plugin

Connecting the IDE to the Application Server

Configuring the IDE to Use the Application Server

Making the Sun ONE Application Server the Default Server

Connecting the IDE and the Application Server to the Database

Defining a JDBC Connection Pool

Registering the Connection Pool

Defining a JDBC Data Source

Registering the JDBC Data Source

Defining a JDBC Persistence Manager

Registering the JDBC Persistence Manager

Creating the Database Tables

Tutorial Database Table Descriptions

2. Introduction to the Tutorial

Functionality of the Tutorial Application

Application Scenarios

Application Functional Specification

User's View of the Tutorial Application

Architecture of the Tutorial Application

Application Elements

EJB Tier Details

Overview of Tasks for Creating the Tutorial Application

Creating the EJB Components

Creating the Tutorial's Web Service

Installing and Using the Provided Client

End Comments

3. Building the EJB Tier of the DiningGuide Application

Overview of the Tutorial's EJB Tier

The Entity Beans

The Session Bean

The Detail Classes

Summary of Steps

Creating Entity Beans With the EJB Builder

Creating the Restaurant and Customerreview Entity Beans

Creating the Customerreview Entity Bean

Creating Create Methods for CMP Entity Beans

Creating Finder Methods on Entity Beans

Creating Business Methods for Testing Purposes

Creating Detail Classes to View Entity Bean Data

Creating the Detail Classes

Creating the Detail Class Properties and Their Accessor Methods

Creating the Detail Class Constructors

Creating Business Methods on the Entity Beans to Fetch the Detail Classes

Testing the Entity Beans

Creating a Test Client for the Restaurant Bean

Providing the Sun ONE Application Server 7 Plugin With Database Information

Deploying and Executing the Restaurant Bean's Test Application

Using the Test Client to Test the Restaurant Bean

Checking the Additions to the Database

Creating a Test Client for the Customerreview Bean

Deploying and Executing the Customerreview Bean's Test Application

Testing the Customerreview Entity Bean

Checking the Additions to the Database

Creating a Session Bean With the EJB Builder

Coding a Session Bean's Create Method

Creating Business Methods to Get the Detail Data

Creating a Business Method to Create a Customer Review Record

Creating Business Methods That Return Detail Class Types

Adding EJB References

Testing the Session Bean

Creating a Test Client for a Session Bean

Providing the Sun ONE Application Server 7 Plugin With Database Information

Deploying and Executing the Test Application

Using the Test Client to Test a Session Bean

Checking the Additions to the Database

Comments on Creating a Client

4. Creating the DiningGuide Application's Web Service

Overview of the Tutorial's Web Service

The Web Service

The Runtime Classes

The Client Proxy Pages

Creating the Tutorial's Web Service

Creating the Web Service Module

Specifying the Web Service's SOAP RPC URL

Generating the Web Service's Runtime Classes

Testing the Web Service

Creating a Test Client and Test Application

Specifying the Web Context Property

Deploying the Test Application

Using the Test Application to Test the Web Service

Making Your Web Service Available to Other Developers

Generating the WSDL File

Generating a Client Proxy From the WSDL File

5. Creating a Client for the Tutorial Application

Creating the Client With the Provided Code

Creating the Client on Microsoft Windows Systems

Creating the Client in Solaris or Linux Environments

Running the Tutorial Application

Examining the Client Code

Displaying Restaurant Data

Displaying Customer Review Data for a Selected Restaurant

Creating a New Customer Review Record

A. DiningGuide Source Files

RestaurantBean.java Source

RestaurantDetail.java Source

CustomerreviewBean.java Source

CustomerreviewDetail.java Source

DiningGuideManagerBean.java Source

RestaurantTable.java Source

CustomerReviewTable.java Source

B. DiningGuide Database Script

Index