Setting up Oracle

These instructions assume that you are using an Oracle database and guide you through the following tasks:

Note. When you create and access the database tables, be aware of the following issues:

Before following these instructions you must have created a database.

Complete the following steps:

  1. Open a new document in a text editor, copy and paste the following script, which creates and populates the DEPARTMENT and EMPLOYEE tables, into the document, name the file simplifieddbrouting2.sql and save the file.
    DROP TABLE DEPARTMENT;
    CREATE TABLE DEPARTMENT (DEPTNUM CHAR(3) NOT NULL, DEPTNAME VARCHAR2(36) NOT NULL, MGRNUM CHAR(6));
    INSERT INTO DEPARTMENT  VALUES('D00', 'Personnel', '000010');
    INSERT INTO DEPARTMENT  VALUES('D01', 'Development', '000020');
    INSERT INTO DEPARTMENT  VALUES('D02', 'Support', '000030');
    DROP TABLE EMPLOYEE;
    CREATE TABLE EMPLOYEE (EMPNUM CHAR(6) NOT NULL, FIRSTNM VARCHAR2(20) NOT NULL, LASTNM VARCHAR2(15) NOT NULL, PHONENUM CHAR(4), WORKDEPT CHAR(3), YEARSSERVICE INTEGER, AGEINYRS INTEGER, SEX CHAR(1), SALARY DECIMAL(9,2));
    INSERT INTO EMPLOYEE  VALUES('000010', 'DAVID', 'BROWN', '4501', 'D01', 10, 54, 'M', 23250.00);
    INSERT INTO EMPLOYEE  VALUES('000020', 'SALLY', 'KWAN', '4738', 'D00', 9, 27, 'F', 18375.00);
    INSERT INTO EMPLOYEE  VALUES('000030', 'JOHN', 'GEYER', '6789', 'D01', 22, 47, 'M', 53000.00);
    INSERT INTO EMPLOYEE  VALUES('000040', 'EVA', 'SMITH', '7831', 'D00', 12, 37, 'F', 29000.00);
          
  2. Start a command window to access your database, move to the folder that contains simplifieddbrouting2.sql and enter the following command:
    sqlplus <uid>/<password> @simplifieddbrouting2.sql

    Wait for the script to finish running. If you are running the script for the first time, the following message is displayed:

    ORA-00942: table or view does not exist
    Ignore this message. The message is displayed because the script attempts to remove any existing tables called DEPARTMENT and EMPLOYEE before it creates new tables, but if you have not run the script before, the script cannot find any existing tables.

You can now create the JDBCProvider definition, see Creating a JDBC provider entry for an Oracle database.

Back to Setting up the database

Back to sample home