·  JAVA – DB – Oracle

 

- Info:

  - This set of tutorials shows how to use Java to work with Oracle database.

  - To be able to follow these tutorials you should create user myUser and table PEOPLE as shown below.

 

- Create myUser:

  - Login as system user.    

  - Execute following SQL statements as Script:

    CREATE USER myUser IDENTIFIED BY myPassword;

    

    GRANT         CREATE SESSION,

                  CREATE TABLE,

                  CREATE SEQUENCE,

                  CREATE VIEW,

                  CREATE PROCEDURE

    TO            myUser

    IDENTIFIED BY myPassword;

 

    GRANT UNLIMITED TABLESPACE TO myUser;

    

- Create Table PEOPLE:

  - Login as myUser.

  - Execute following SQL statements as Script:

    CREATE TABLE PEOPLE (

      NAME  VARCHAR2(10),

      AGE   NUMBER  (3),

      BORN  DATE

    );

    INSERT INTO PEOPLE(NAME, AGE, BORN) VALUES ('Ivor', 33, TO_DATE('28.02.1976', 'DD.MM.YYYY'));

    INSERT INTO PEOPLE(NAME, AGE, BORN) VALUES ('John', 25, TO_DATE('28.02.1280', 'DD.MM.YYYY'));