edu.sc.seis.fissuresUtil.rt130
Class StationLocationUpdater

java.lang.Object
  extended by edu.sc.seis.fissuresUtil.rt130.StationLocationUpdater

public class StationLocationUpdater
extends java.lang.Object


Constructor Summary
StationLocationUpdater()
           
 
Method Summary
static java.util.Map getIncorrectLocations(java.sql.Connection conn, java.util.Map stationToLocation)
          If the stationToLocation map contains a location not in the db, that location is inserted and the station code entry in the returned map points to that location id.
static void main(java.lang.String[] args)
           
static void update(java.sql.Connection conn, java.util.Map stationToLocationId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StationLocationUpdater

public StationLocationUpdater()
Method Detail

update

public static void update(java.sql.Connection conn,
                          java.util.Map stationToLocationId)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getIncorrectLocations

public static java.util.Map getIncorrectLocations(java.sql.Connection conn,
                                                  java.util.Map stationToLocation)
                                           throws java.sql.SQLException,
                                                  NotFound
If the stationToLocation map contains a location not in the db, that location is inserted and the station code entry in the returned map points to that location id. If the location is already in the db, but the station has a different location id, the map contains that station code and the correct location id. If the station already has the correct id in the db, it isn't in the returned map at all.

Returns:
- A map of station code to its correct station id.
Throws:
java.sql.SQLException
NotFound

main

public static void main(java.lang.String[] args)
                 throws java.io.FileNotFoundException,
                        java.io.IOException,
                        java.sql.SQLException,
                        NotFound
Throws:
java.io.FileNotFoundException
java.io.IOException
java.sql.SQLException
NotFound