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.
-
NUMCITIES
-
-
theCities
-
-
InsertCities()
-
-
confirmInsert(Connection)
- Shows data inserted to verify.
-
createSQLScript(Connection)
-
-
extractDataForReInsert(Connection)
-
-
insert(Connection)
- Inserter method inserts the cities in the array
using one PreparedStatement executed many times.
-
prepareStatements(Connection)
-
NUMCITIES
public static int NUMCITIES
theCities
public City theCities[]
InsertCities
public InsertCities()
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.
prepareStatements
public boolean prepareStatements(Connection conn) throws SQLException
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.
extractDataForReInsert
public void extractDataForReInsert(Connection conn) throws SQLException
createSQLScript
public boolean createSQLScript(Connection conn) throws SQLException
All Packages Class Hierarchy This Package Previous Next Index