All Packages Class Hierarchy This Package Previous Next Index
Class JBMSTours.inserters.InsertFlights
java.lang.Object
|
+----JBMSTours.inserters.InsertFlights
- public class InsertFlights
- extends Object
- implements Inserters
Look at the Source.
This class inserts the flights data
(the Flights and the Airlines tables).
-
InsertFlights()
-
-
airlineEntry(String, String, double, double, double, double)
- Enters data for a single airline into the database.
-
confirmInsert(Connection)
-
-
createSQLScript(Connection)
-
-
estimateArrival(Connection, int, int, Time)
- Use this to create new flights if necessary.
-
extractDataForReInsert(Connection)
- A home-made method for exporting data.
-
fullFlightEntry(String, int, String, Time, String, Time, String, double, int, String)
- Enters a single flight into the database.
-
insert(Connection)
- Inserts a large amount of flight data.
-
prepareStatements(Connection)
-
InsertFlights
public InsertFlights()
insert
public boolean insert(Connection conn) throws SQLException
- Inserts a large amount of flight data.
- Parameters:
- conn - the name of the connection
- Throws: SQLException
- Thrown if there is a SQL error.
prepareStatements
public boolean prepareStatements(Connection conn) throws SQLException
fullFlightEntry
protected int fullFlightEntry(String flt,
int seg,
String ap1,
Time t1,
String ap2,
Time t2,
String meal,
double ft,
int m,
String ac) throws SQLException
- Enters a single flight into the database.
- Parameters:
- conn - the connection to the database
- flt - flight ID
- seg - segment number
- ap1 - airport from which the flight departs
- t1 - departure time
- ap2 - destination airport
- t2 - arrival time
- meal - meal served on the flight
- ft - duration of the flight
- m - length of the flight in miles
- ac - type of aircraft
- Returns:
- the number of rows inserted
- Throws: SQLException
- Thrown if there is a SQL error.
airlineEntry
protected int airlineEntry(String airline,
String airlineFull,
double br,
double dd,
double blf,
double fcl) throws SQLException
- Enters data for a single airline into the database.
- Parameters:
- airline - the abbreviated name of the airline
- airlineFull - the full name of the airline
- br - the basic rate
- dd - the distance discount
- blf - the price points for business class
- fcl - the price points for first class
- Returns:
- the number of rows inserted
- Throws: SQLException
- if there is a SQL error
confirmInsert
public void confirmInsert(Connection conn) throws SQLException
extractDataForReInsert
public void extractDataForReInsert(Connection conn) throws SQLException
- A home-made method for exporting data.
- Parameters:
- conn - the connection to the database
- Throws: SQLException
- Thrown if there is a SQL error.
createSQLScript
public boolean createSQLScript(Connection conn) throws SQLException
estimateArrival
public static Time estimateArrival(Connection conn,
int cid1,
int cid2,
Time departure) throws SQLException
- Use this to create new flights if necessary.
- Parameters:
- conn - the connection to the database
- cid1 - cityid of departure city
- cid2 - cityid of destination city
- departure - time of departure
- Returns:
- time of arrival
- Throws: SQLException
- Thrown if there is a SQL error.
All Packages Class Hierarchy This Package Previous Next Index