All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JBMSTours.inserters.InsertCities

java.lang.Object
   |
   +----JBMSTours.inserters.InsertCities

public class InsertCities
extends Object
implements Inserters
Look at the Source.

Basic "inserter" class for City objects. Initializes an array of City objects before inserting them. Note: the location and weather information is not guaranteed to be accurate.


Variable Index

 o NUMCITIES
 o theCities

Constructor Index

 o InsertCities()

Method Index

 o confirmInsert(Connection)
Shows data inserted to verify.
 o createSQLScript(Connection)
 o extractDataForReInsert(Connection)
 o insert(Connection)
Inserter method inserts the cities in the array using one PreparedStatement executed many times.
 o prepareStatements(Connection)

Variables

 o NUMCITIES
 public static int NUMCITIES
 o theCities
 public City theCities[]

Constructors

 o InsertCities
 public InsertCities()

Methods

 o insert
 public boolean insert(Connection conn) throws SQLException
Inserter method inserts the cities in the array using one PreparedStatement executed many times.

Parameters:
conn - Connection
Returns:
boolean true if number of cities inserted is correct.
Throws: SQLException
Thrown if there is a SQL error.
 o prepareStatements
 public boolean prepareStatements(Connection conn) throws SQLException
 o confirmInsert
 public void confirmInsert(Connection conn) throws SQLException
Shows data inserted to verify. Uses a method invocation to show the city names. query is: select city.getName() from Cities

Parameters:
conn - Connection
Throws: SQLException
Thrown if there is a SQL error.
 o extractDataForReInsert
 public void extractDataForReInsert(Connection conn) throws SQLException
 o createSQLScript
 public boolean createSQLScript(Connection conn) throws SQLException

All Packages  Class Hierarchy  This Package  Previous  Next  Index