All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JBMSTours.BuildATour

java.lang.Object
   |
   +----JBMSTours.BuildATour

public class BuildATour
extends Object
Look at the source.

Run this program after creating the database with CreateToursDB. (It outputs messages as it runs. It takes a few minutes.)

This program queries the core tables and builds one customized tour object, storing booking information in the database (FlightBookings, FlightAvailability, HotelBookings, and HotelAvailability), and storing the tour objects in the table CustomizedTours. It also uses the table FlightObjects as a temporary repository for Flight objects.

This is a simple program that doesn't have a user interface. (Instead of getting data from user input, it gets it from a hash table). It does present a really simple scenario of how to use the classes and the database. It also provides an example of how to set a property within an application.

This class has a main() method and can be run from the command-line. For complete instructions on how to run it, see the example instructions.


Variable Index

 o mymode

Constructor Index

 o BuildATour(ApplicationMode)

Method Index

 o buildOneTour(Connection, boolean)
Builds one Tour object.
 o getPeopleAndGroupData(Connection)
gets people and group data from a hash table (instead of from users!) and sets the city and travel date variables according to preferences of the group
 o main(String[])

Variables

 o mymode
 public ApplicationMode mymode

Constructors

 o BuildATour
 public BuildATour(ApplicationMode am)

Methods

 o main
 public static void main(String args[])
 o getPeopleAndGroupData
 public void getPeopleAndGroupData(Connection conn) throws SQLException, Throwable
gets people and group data from a hash table (instead of from users!) and sets the city and travel date variables according to preferences of the group

Parameters:
conn - Current connection to the database.
Throws: SQLException
if database error
Throws: Throwable
if Connection error
 o buildOneTour
 public void buildOneTour(Connection conn,
                          boolean prebuild) throws SQLException, CityChoiceException, BudgetException, AvailabilityException, Throwable
Builds one Tour object.

Parameters:
conn - Current connection to the database.
boolean - whether we're prebuilding the database or not
Throws: SQLException
if database error
Throws: CityChoiceException
if it can't build tour to requested cities
Throws: BudgetException
if it can't build tour to requested cities within budget
Throws: AvailabilityException
if it can't build tour to requested cities because flights or hotels are not available
Throws: Throwable
if database boot/connection problem

All Packages  Class Hierarchy  This Package  Previous  Next  Index