main
Class DBAccess

java.lang.Object
  extended by main.DBAccess

public class DBAccess
extends java.lang.Object

Provides access to and functionality for the database containing the candidate sets.

Additional Notes:
Added on 12/20/05 by Adarsh Uppula:

 Functionality requires the postgresql package to be installed.
 
Last Modified by:
Adarsh Uppula
Last Modified on:
12/20/2005
Since:
JDK 1.1
To Do:
Get the other database to work?

Field Summary
static java.lang.String[] filters
           
static java.lang.String url
           
 
Constructor Summary
DBAccess()
           
 
Method Summary
static java.util.Vector getAllCandInfo(java.sql.Connection con)
          read all candidate entries
static java.util.Vector getAllCandInfo(java.sql.Connection con, java.util.Vector sets)
          read all candidate entries in the given sets
static java.util.Vector getAllGroupNames(java.sql.Connection con)
          Gets the all the group names in the database.
static java.util.Vector getAllStandFields(java.sql.Connection con)
          gets all the standard star fields (name, ra, dec)
static Sixty getCandDEC(java.sql.Connection con, java.lang.String scpName)
          Gets the DEC of a candidate
static java.util.Vector getCandDEC(java.sql.Connection con, java.util.Vector scpNames)
          Gets the DEC of specified candidates
static CandInfo getCandInfo(java.sql.Connection con, java.lang.String cand)
          read a candidate's entries
static Sixty getCandRA(java.sql.Connection con, java.lang.String scpName)
          Gets the RA of a candidate
static java.util.Vector getCandRA(java.sql.Connection con, java.util.Vector scpNames)
          Gets the RA of specified candidates
static java.util.Vector getCandRaDec(java.sql.Connection con)
          gets all the candidates positions (name, ra, dec)
static java.util.Vector getCandScpNames(java.sql.Connection con)
          Gets the scp names of all the candidates in the database
static java.util.Vector getCandScpNames(java.sql.Connection con, boolean showAll)
          Gets the scp names of all the candidates in the database
static double getFullPriority(java.sql.Connection con, java.lang.String cand, java.lang.String type, java.lang.String filt)
          Gets the priority (0.0-10.0 or more) for a given candidate, type, and filter as a double.
static double getFullPriority(java.sql.Connection con, java.lang.String cand, java.lang.String type, java.lang.String filt, boolean noObservers)
          Gets the priority (0.0-10.0 or more) for a given candidate, type, and filter as a double.
static java.lang.String getGroupName(java.sql.Connection con, java.lang.String site)
          get the default group name for a site.
static int getOverAllPriority(java.sql.Connection con, java.lang.String cand)
          Gets the over all priority for a given candidate.
static java.util.Hashtable getPhotInfo(java.sql.Connection con)
          Gets all the info about the photometric stands in the db
static java.util.Vector getPhotStands(java.sql.Connection con)
          gets all the photometric standard stars (name, ra, dec)
static void getSiteParams(java.sql.Connection con, java.lang.String site, java.util.Hashtable hash)
          Reads the database and returns the elevation of a telescope scope.
static float getSiteParams(java.sql.Connection con, java.lang.String site, java.util.Vector latAndLong)
          Reads the database and returns the elevation of a telescope scope.
static java.util.Vector getStandards(java.sql.Connection con, double minRA, double maxRA, double minDEC, double maxDEC)
          gets all the standard stars in a range (name, ra, dec).
static java.util.Vector getTelescopes(java.sql.Connection con)
          Gets the available telescopes
static java.lang.String getTimeZone(java.sql.Connection con, java.lang.String site)
          get the default TimeZone ID for a given site.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

url

public static final java.lang.String url
See Also:
Constant Field Values

filters

public static java.lang.String[] filters
Constructor Detail

DBAccess

public DBAccess()
Method Detail

getTelescopes

public static java.util.Vector getTelescopes(java.sql.Connection con)
Gets the available telescopes


getCandScpNames

public static java.util.Vector getCandScpNames(java.sql.Connection con)
Gets the scp names of all the candidates in the database


getCandScpNames

public static java.util.Vector getCandScpNames(java.sql.Connection con,
                                               boolean showAll)
Gets the scp names of all the candidates in the database


getAllGroupNames

public static java.util.Vector getAllGroupNames(java.sql.Connection con)
Gets the all the group names in the database.


getCandRA

public static Sixty getCandRA(java.sql.Connection con,
                              java.lang.String scpName)
Gets the RA of a candidate


getCandRA

public static java.util.Vector getCandRA(java.sql.Connection con,
                                         java.util.Vector scpNames)
Gets the RA of specified candidates


getCandDEC

public static Sixty getCandDEC(java.sql.Connection con,
                               java.lang.String scpName)
Gets the DEC of a candidate


getCandDEC

public static java.util.Vector getCandDEC(java.sql.Connection con,
                                          java.util.Vector scpNames)
Gets the DEC of specified candidates


getSiteParams

public static float getSiteParams(java.sql.Connection con,
                                  java.lang.String site,
                                  java.util.Vector latAndLong)
Reads the database and returns the elevation of a telescope scope. Sets lat and longit to the site latitude and longitude. Returns 0 if an error occurs.


getSiteParams

public static void getSiteParams(java.sql.Connection con,
                                 java.lang.String site,
                                 java.util.Hashtable hash)
Reads the database and returns the elevation of a telescope scope. Sets "latitude", "longitude", and "elevation" in the hash to the site values as Sixty, Sixty, and Double.


getFullPriority

public static double getFullPriority(java.sql.Connection con,
                                     java.lang.String cand,
                                     java.lang.String type,
                                     java.lang.String filt)
Gets the priority (0.0-10.0 or more) for a given candidate, type, and filter as a double. A return value of -99 signals an error


getFullPriority

public static double getFullPriority(java.sql.Connection con,
                                     java.lang.String cand,
                                     java.lang.String type,
                                     java.lang.String filt,
                                     boolean noObservers)
Gets the priority (0.0-10.0 or more) for a given candidate, type, and filter as a double. A return value of -99 signals an error. Strips the n*100 observers value if(noObservers).


getGroupName

public static java.lang.String getGroupName(java.sql.Connection con,
                                            java.lang.String site)
get the default group name for a site.


getCandInfo

public static CandInfo getCandInfo(java.sql.Connection con,
                                   java.lang.String cand)
read a candidate's entries


getAllCandInfo

public static java.util.Vector getAllCandInfo(java.sql.Connection con)
read all candidate entries


getAllCandInfo

public static java.util.Vector getAllCandInfo(java.sql.Connection con,
                                              java.util.Vector sets)
read all candidate entries in the given sets


getTimeZone

public static java.lang.String getTimeZone(java.sql.Connection con,
                                           java.lang.String site)
get the default TimeZone ID for a given site.


getAllStandFields

public static java.util.Vector getAllStandFields(java.sql.Connection con)
gets all the standard star fields (name, ra, dec)


getPhotStands

public static java.util.Vector getPhotStands(java.sql.Connection con)
gets all the photometric standard stars (name, ra, dec)


getStandards

public static java.util.Vector getStandards(java.sql.Connection con,
                                            double minRA,
                                            double maxRA,
                                            double minDEC,
                                            double maxDEC)
gets all the standard stars in a range (name, ra, dec). Expects minRA

getCandRaDec

public static java.util.Vector getCandRaDec(java.sql.Connection con)
gets all the candidates positions (name, ra, dec)


getOverAllPriority

public static int getOverAllPriority(java.sql.Connection con,
                                     java.lang.String cand)
Gets the over all priority for a given candidate. A return value of -99 signals an error


getPhotInfo

public static java.util.Hashtable getPhotInfo(java.sql.Connection con)
Gets all the info about the photometric stands in the db