net.agmodel.metDriver
Class WakayamaRainDB

java.lang.Object
  extended bynet.agmodel.dbUtility.InternetHost
      extended bynet.agmodel.dbUtility.JDBC
          extended bynet.agmodel.dbUtility.JDBCPostgres
              extended bynet.agmodel.metDriver.WakayamaRainDB
All Implemented Interfaces:
AccessMechanism, DBAccessMechanism, MetAccessMechanism

public class WakayamaRainDB
extends JDBCPostgres
implements MetAccessMechanism

Provides access to a PostgreSQL database of Japanese Prefectural met data.

Author:
Matthew Laurenson

Constructor Summary
WakayamaRainDB(MetSourceForDrivers metSource, Properties properties)
           
 
Method Summary
 boolean connect(String username, String password)
          Overrides the default net.agmodel.dbUtility in order to set the datestyle used in subsequent operations.
Seems like the Postgres JDBC driver requires datestyle='ISO' for date/time operations.
 TimeZone getDatabaseTimeZone()
           
 PreparedStatement prepareRequestQuery(MetRequest request)
           
 void queryForStation(MetRequest request, String stationID, StationDataSetImpl result)
          Retrieve the relevant data from a single station.
 void updateRegionList()
          Update the list of regions (if any) held by the MetSource
 void updateStationList(String fromStation)
          Update the list of stations held by the MetSource
 
Methods inherited from class net.agmodel.dbUtility.JDBC
checkForDatabaseUpdates, connectForData, connectForMetaData, disconnectFromData, disconnectFromMetaData, getConn
 
Methods inherited from class net.agmodel.dbUtility.InternetHost
getHost, getPort
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.agmodel.brokerImpl.DBAccessMechanism
checkForDatabaseUpdates, connectForData, connectForMetaData, disconnectFromData, disconnectFromMetaData
 

Constructor Detail

WakayamaRainDB

public WakayamaRainDB(MetSourceForDrivers metSource,
                      Properties properties)
Method Detail

getDatabaseTimeZone

public TimeZone getDatabaseTimeZone()
Specified by:
getDatabaseTimeZone in interface MetAccessMechanism

prepareRequestQuery

public PreparedStatement prepareRequestQuery(MetRequest request)
                                      throws ConnectionException
Throws:
ConnectionException

queryForStation

public void queryForStation(MetRequest request,
                            String stationID,
                            StationDataSetImpl result)
                     throws ConnectionException
Description copied from interface: MetAccessMechanism
Retrieve the relevant data from a single station.

Specified by:
queryForStation in interface MetAccessMechanism
Parameters:
request - describes what data is required
stationID - identifies which station from the met data source to query
result - the skeletal query result (created by MetSourceImpl) for the driver fill in with data hostID is the native identifier for the station on the host database system.
If the request is a StationMetRequest, then the hostID will also be embedded in the request but should be ignored by this method. If there is no data at all for the station, this method should return the skeletal query result untouched. If there is no data for a particular element, then no corresponding sequence should be inserted into the StationDataSetImpl.
Throws:
ConnectionException

updateStationList

public void updateStationList(String fromStation)
                       throws GeneralException
Description copied from interface: MetAccessMechanism
Update the list of stations held by the MetSource

Specified by:
updateStationList in interface MetAccessMechanism
Parameters:
fromStation - start the update from this station (the driver may ignore this value and update all stations) The fromStation parameter is intended to help with large databases where, particularly during driver development, the updating process may fail midway through. It avoids the need to start again from the beginning. Drivers are welcome to entirely ignore this parameter. A null parameter value indicates that updating should start from the beginning.
Throws:
GeneralException

connect

public boolean connect(String username,
                       String password)
                throws ConnectionException
Description copied from class: JDBCPostgres
Overrides the default net.agmodel.dbUtility in order to set the datestyle used in subsequent operations.
Seems like the Postgres JDBC driver requires datestyle='ISO' for date/time operations.

Overrides:
connect in class JDBCPostgres
Throws:
ConnectionException

updateRegionList

public void updateRegionList()
                      throws GeneralException
Description copied from interface: MetAccessMechanism
Update the list of regions (if any) held by the MetSource

Specified by:
updateRegionList in interface MetAccessMechanism
Throws:
GeneralException


Copyright (C) NARC 2001 All Rights Reserved.