grs.pds
Class TimeQuery

java.lang.Object
  |
  +--grs.pds.TimeQuery

public abstract class TimeQuery
extends Object

Abstract Base class for time-range constrained SQL queries. Contains static method for determining appropriate schema.


Field Summary
static long TIME_OF_LCH
          start of cruise phase
static long TIME_OF_MAP
          start of mapping phase
static long TIME_OF_MOI
          start of aerobraking phase
 
Constructor Summary
TimeQuery(Connection conn)
          Set the Connection.
TimeQuery(Connection conn, String type)
          Set the Connection.
 
Method Summary
static String getSchema(long sctime)
          We now have different schemas for each mission phase.
abstract  int query(long start, long stop)
          Subclasses will provide this method implementation.
 int query(String utc0, String utc1)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIME_OF_LCH

public static final long TIME_OF_LCH
start of cruise phase

See Also:
Constant Field Values

TIME_OF_MOI

public static final long TIME_OF_MOI
start of aerobraking phase

See Also:
Constant Field Values

TIME_OF_MAP

public static final long TIME_OF_MAP
start of mapping phase

See Also:
Constant Field Values
Constructor Detail

TimeQuery

public TimeQuery(Connection conn)
Set the Connection.

Parameters:
conn - JDBC Connection to our Oracle database.

TimeQuery

public TimeQuery(Connection conn,
                 String type)
Set the Connection.

Parameters:
conn - JDBC Connection to our Oracle database.
type - product
Method Detail

getSchema

public static String getSchema(long sctime)
We now have different schemas for each mission phase. Given a time, this will tell you which schema to use.

Parameters:
sctime - Spacecraft clock ticks
Returns:
Name of schema.

query

public int query(String utc0,
                 String utc1)
          throws IOException,
                 SQLException,
                 SpiceException
Parameters:
utc0 -
utc1 -
Returns:
Throws:
IOException
SQLException
SpiceException

query

public abstract int query(long start,
                          long stop)
                   throws IOException,
                          SQLException
Subclasses will provide this method implementation. Should return the number of rows selected.

Parameters:
start - ticks
stop - ticks
Returns:
number of rows processed
Throws:
IOException - Stream error.
SQLException - Database error.


2001 Mars Odyssey Gamma Ray Spectrometer Team