Skip Headers

Before You Begin

Previous
Previous
 
Next
Next

This section contains important information on installing and configuring your tutorial environment. You should read this section before starting the tutorial.

Prerequisites

To complete this tutorial, ensure that you have the following software installed and properly configured:

Refer to the Oracle Toplink Developer's Guide for complete information on using TopLink

Obtaining the Tutorial Files

To complete the tutorial project, you will need to download the tutorial source files. These files contain the Java classes used to build the project and the SQL scripts to create the database.

http://www.oracle.com/technology/products/ias/toplink/doc/10131/MAIN/_tutorial/advanced/Advanced_Tutorial.zip

Unzip the Advanced_Tutorial to your <ADVANCED_TUTORIAL_HOME> directory.

Setting up the Database

In this tutorial, you will connect to a relational database. This tutorial includes information on using Oracle Express Edition.

  1. Download and install Oracle Database 10g Express Edition:

    http://www.oracle.com/technology/products/database/xe/index.html

  2. Create a new user, scott (password = tiger), with full create privileges.

  3. Login as user scott and execute the createTables.sql and populateTables.sql SQL scripts to create and populate the database. The following table describes the database structure:

    Table Column Description
    ADDRESS ADDRESS_ID NUMBER(15,0), Primary key
    CITY VARCHAR2(80)
    COUNTRY VARCHAR2(80)
    P_CODE VARCHAR2(80)
    PROVINCE VARCHAR2(80)
    STREET VARCHAR2(80)
    EMPLOYEE ADD_ID NUMBER(15,0), Foreign key relationship to ADDRESS.ADDRESS_ID
    EMP_ID NUMBER(15,0), Primary key
    F_NAME VARCHAR2(40)
    L_NAME VARCHAR2(40)
    VERSION NUMBER(15,0)
    ADDR_ID NUMERIC(15), Foreign key reference to ADDRESS.ADDRESS_ID
    EMP_ID NUMERIC(15), Primary key

    Foreign key reference to SALARY.EMP_ID

    END_DATE DATE
    END_TIME TIME
    F_NAME VARCHAR(40)
    GENDER CHAR(1)
    L_NAME VARCHAR(40)
    MANAGER_ID NUMERIC(15), Foreign key reference to EMPLOYEE.EMP_ID
    START_DATE DATE
    START_TIME TIME
    VERSION NUMERIC(15)
    LPROJECT BUDGET NUMERIC(10,2)
    MILESTONE DATE
    PROJ_ID NUMERIC(15), Primary key
    BUDGET NUMERIC(10,2)
    PHONE AREA_CODE VARCHAR2(3)
    EMP_ID NUMBER(15,0), Primary key
    P_NUMBER VARCHAR2(7)
    TYPE VARCHAR2(15)
    PROJ_EMP EMP_ID NUMERIC(15), Primary key

    Foreign key reference to EMPLOYEE.EMP_ID

    PROJ_ID NUMERIC(15), Primary key

    Foreign key reference to PROJECT.PROJ_ID

    PROJECT DESCRIP VARCHAR(200)
    LEADER_ID NUMERIC(15), Foreign key reference to EMPLOYEE.EMP_ID
    PROJ_ID NUMERIC(15), Primary key
    PROJ_NAME VARCHAR(30)
    PROJ_TYPE CHAR(1)
    VERSION NUMERIC(15)
    SEQUENCE SEQ_COUNT NUMBER(38,0)
    SEQ_NAME VARCHAR2(50)