You need to prepare your working environment to support the tutorial application. To do this, you perform the following key tasks:
- Prepare to install the schema
- Create the SRDEMO schema owner and install the Service Request schema
- Start Oracle JDeveloper 10g Release 3
- Create a JDeveloper database connection
- Define an application and projects for the tutorial
Preparing to Install the Schema
The schema consists of five tables and three database sequences. The tables are diagrammed as follows:
The five tables represent creating and assigning a service request to a qualified technician.
USERS: This table stores all the users who interact with the system, including customers, technicians, and managers. The e-mail address, first and last name, street address, city, state, postal code, and country of each user are stored. An ID uniquely identifies a user.
SERVICE_REQUESTS: This table represents both internal and external requests for activity on a specific product. In all cases, the requests are for a solution to a problem with a product. When a service request is created, the date of the request, the name of the individual who opened it, and the related product are all recorded. A short description of the problem is also stored. After the request is assigned to a technician, the name of the technician and date of assignment are also recorded. An artificial ID uniquely identifies all service requests.
SERVICE_HISTORIES: For each service request, there may be many events recorded. The date the request was created, the name of the individual who created it, and specific notes about the event are all recorded. Any internal communications related to a service request are also tracked. The service request and its sequence number uniquely identify each service history.
PRODUCTS: This table stores all of the products handled by the company. For each product, the name and description are recorded. If an image of the product is available, that too is stored. An artificial ID uniquely identifies all products.
EXPERTISE_AREAS: To better assign technicians to requests, the specific areas of expertise of each technician are defined.
USERS_SEQ: Populates the ID for new users
PRODUCTS_SEQ: Populates the ID for each product
SERVICE_REQUESTS_SEQ: Populates the ID for each new service request
- Obtain the ADF_tutorial_setup.zip file at the following location: http://download.oracle.com/otndocs/products/jdev/1013/ADF tutorial setup.zip
- Unzip the file to a temporary directory (e.g., C:\temp\ADFTutorialSetup\) to expose the files that are used to create the three images for the Web pages. For the remainder of the tutorial, this directory is referred to as <tutorial_install>.
Installing the Service Request Schema
The SRDEMO user owns the data displayed in the application. Access to an Oracle SYSTEM user or equivalent is required to create the user account and to assign the appropriate privileges. The createSchema.sql file contains all the commands necessary to create the database user. The createSchemaObjects.sql file connects as the SRDEMO user and creates all the tables, constraints, and database sequences for the tutorial. Finally, the populateSchemasTables.sql file inserts example data into the tables for use during the tutorial.
Caution: For security reasons, it is not advisable to install the ADF tutorial schema into a production database. You may need the assistance of your DBA to access an account with the privilege to create a user.
- Invoke SQL*Plus and log on as SYSTEM or as another DBA-level user. You may need to ask your DBA to give you an account or to run the scripts for you.
- In the SQL*Plus window, start the build.sql script from the directory where you unzipped it. For example:
After control is returned to the build.sql script, the list of the created objects is displayed along with any potential invalid objects. Running these scripts should take less than 30 seconds. You may rerun the build.sql script to drop and re-create the SRDEMO owner and objects.
Starting Oracle JDeveloper
Follow these instructions to prepare JDeveloper Studio.
Note: If you have not already installed JDeveloper 10g Release 3, then do so before proceeding with the next tutorial steps.
- In Windows Explorer, navigate to the directory where JDeveloper is installed. In the root directory, double-click the JDeveloper.exe icon to invoke JDeveloper. If this is the first time JDeveloper has been run, a “Do you wish to migrate” window appears.
- Click No to continue. You will build the entire application from scratch.
- On startup, a “Tip of the Day” window appears. These tips are things you can do to make development more productive. Click Close when you’ve finished looking at the tips.
Creating a Database Connection to Access the SRDEMO Schema
Follow these instructions to create a new database connection to the Service Request schema using the SRDEMO user.
Note: In the tutorial, the database connection is named SRDemo. The name of the connection does not affect the ability to complete the tutorial. However, we strongly recommend using the naming conventions described in all the steps. In doing so, it is easier to follow the instructions.
- In JDeveloper, choose View > Connections Navigator.
- Right-click the Database node and choose New Database Connection.
- Click Next on the Welcome page.
- In the Connection Name field, type the connection name SRDemo. Then click Next.
- On the Authentication page, enter the values as shown in the following table. Then click Next.
Deploy Select the check box
- On the Connection page, enter the following values. Then click Next.
Host Name localhost
This is the default host name if the database is on the same machine as JDeveloper. If the database is on anther machine, type the name (or IP address) of the computer where the database is located.
JDBC Port 1521
This is the default value for the port used to access the database. If you do not know this value, check with your database administrator.
This is the default value for the SID that is used to connect to the database. If you do not know this value, check with your database administrator.
- Click Test Connection. If the database is available and the connection details are correct, then continue. If not, click the Back button and check the values.
- Click Finish. The connection now appears below the Database Connection node in the Connections Navigator.
- You can now examine the schema from JDeveloper. In the Connections Navigator, expand Database > SRDemo. Browse the database elements for the schema and confirm that they match the schema definition above.