Cloudscape Database Applications
Page 5 of 5

Running the BuildATour Application

BuildATour is the so-called front-end user application for the JBMSTours company. We refer to it as "so-called" because it doesn't really have a user interface. For the sake of simplicity, it automatically provides some data that a user might enter, then generates a customized tour based on information from the database and stores some information. The application illustrates how an application can interact with Cloudscape, not how an application interacts with a user.

In this section, you will run the BuildATour application, then look at parts of it to see more sophisticated use of statements.

Then you will take a quick look at the data entered by the application.

Run JBMSTours.BuildATour

  1. Return to your open command window (the one you opened in Run and Examine HelloWorldApp.java).
  2. Run the program, redirecting the output to the file buildout.txt:

    java -Dcloudscape.system.home= your_tutorial_system JBMSTours.BuildATour > buildout.txt

    When the program runs, it writes information about the tours it is building to the output file.

  3. Run the same program again two or three times. It will build different tours and insert more data.

    Open buildout.txt and examine the program's output.

    Quiz: Did BuildATour write new data to the database?

    Answer: Yes. It added or updated data in several tables. Try any of the following queries from Cloudview:

    SELECT Flights.flight_id,
        Flights.segment_number, flight_date,
        economy_seats_taken, business_seats_taken,
        firstclass_seats_taken
    FROM Flights JOIN FlightAvailability
    USING (flight_id, segment_number);

    SELECT city.getName() AS CITY, hotels.hotel_name AS HOTEL, booking_date, rooms_taken
    FROM Cities, Hotels, HotelAvailability
    WHERE Cities.city_id = Hotels.city_id
    AND Hotels.hotel_id =
        HotelAvailability.hotel_id;

    SELECT Groups.group_id, People.person_id,
        person
        FROM Groups, People, Groups_People
        WHERE Groups.group_id = Groups_People.group_id
        AND People.person_id = Groups_People.person_id;

    SELECT *
    FROM Groups;

    SELECT customized_tour.toString()
    FROM CustomizedTours;