Sun GlassFish Mobility Platform 1.1 Installation Guide

Populating the album Table

The album table in the musicdb database was created during the Sun GlassFish Mobility Platform installation, but it does not contain any data. This procedure explains how to populate the album table so you have data to manipulate with your client application in subsequent steps.

If you have a two-tier Sun GlassFish Mobility Platform installation, perform this task on the tier2, or Enterprise tier, system.

    Complete the following steps to add data to the album table:

  1. Connect to the musicdb database.

    If you are using Oracle, start SQL*Plus and connect as follows:


    $ sqlplus musicdbuser/musicdbpass@musicdb
    

    If you are using MySQL, start the mysql utility and connect as follows:


    $ mysql -umusicdbuser -pmusicdbpass musicdb
    
  2. Verify that the album table was created during the Sun GlassFish Mobility Platform installation and that it has no contents:


    select * from album;
    
  3. Add your first album:


    insert into album (name, artist, date_published, rating, username) 
    values ('Crossroads', 'Eric Clapton', DATE '1988-04-18', 5, 'musicdbuser');
    
  4. Add another album:


    insert into album (name, artist, date_published, rating, username) 
    values ('Unplugged', 'Eric Clapton', DATE '1992-08-25', 5, 'musicdbuser');
    
  5. Add a third album:


    insert into album (name, artist, date_published, rating, username) 
    values ('The Road to Escondido', 'Eric Clapton', DATE '2006-11-06', 
    5, 'musicdbuser');
    
  6. If you are using Oracle, commit your changes.


    sqlplus> commit;
    
  7. Check that the album table contains the three albums that you just added:


    select * from album;
    
  8. Exit the utility:


    exit