Before You Begin |
![]() Previous |
![]() 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:
Oracle JDeveloper 10.1.3.1
http://www.oracle.com/technology/products/jdev/index.html
JUnit extension for Oracle JDeveloper
http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/index.html
A relational database. This tutorial uses Oracle Database 10g Express Edition that can be obtained from:
http://www.oracle.com/technology/products/database/xe/index.html
Refer to the Oracle Toplink Developer's Guide for complete information on using TopLink
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.
Unzip the Advanced_Tutorial to your <ADVANCED_TUTORIAL_HOME> directory.
The src folder contains the Java source files.
The mw folder is empty and is not used in this tutorial.
The sql folder contains the SQL script to create and populate the database.
In this tutorial, you will connect to a relational database. This tutorial includes information on using Oracle Express Edition.
Download and install Oracle Database 10g Express Edition:
http://www.oracle.com/technology/products/database/xe/index.html
Create a new user, scott (password = tiger), with full create privileges.
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 | 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) |
In this step, you will create a new database connection in Oracle JDeveloper to the database that you previously set up.
Select File > New. The New Gallery appears.
In the Categories pane select Database Tier. In the Items pane select Database Connection and click OK. The Create Database Connection wizard appears.
Complete this wizard to create the database connection. Use the information in the following table to complete the wizard:
| Field | Description |
|---|---|
| Connection Name | DBConnection1 |
| Connection Type | Oracle (JDBC) |
| User Name | scott |
| Password | tiger |
| Role | XE |
| Driver | oracle.jdbc.OracleDriver |
| Host Name | localhost |
| JDBC Port | 1521 |
| SID | Do not select the Service Name option. |
The Connections Navigator shows the new database connection.