Class ConeSelector


  • public abstract class ConeSelector
    extends java.lang.Object
    Abstract class for an object which can make a JDBC SELECT query corresponding to cone searches.
    Since:
    9 Jan 2007
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ConeSelector​(java.sql.Connection connection, java.lang.String tableName, java.lang.String raCol, java.lang.String decCol, AngleUnits units, java.lang.String cols, java.lang.String where)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      static ConeSelector createSelector​(java.sql.Connection connection, java.lang.String tableName, java.lang.String raCol, java.lang.String decCol, AngleUnits units, java.lang.String cols, java.lang.String where, boolean usePrepared)
      Returns a new selector object which just queries on RA and Dec values.
      static ConeSelector createTiledSelector​(java.sql.Connection connection, java.lang.String tableName, java.lang.String raCol, java.lang.String decCol, AngleUnits units, java.lang.String cols, java.lang.String where, java.lang.String tileCol, SkyTiling tiling, boolean usePrepared)
      Returns a new selector object which queries using RA, Dec and a spatial tiling value.
      abstract java.sql.ResultSet executeQuery​(double ra, double dec, double sr)
      Returns an SQL ResultSet containing the records corresponding to a cone search with the given parameters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConeSelector

        protected ConeSelector​(java.sql.Connection connection,
                               java.lang.String tableName,
                               java.lang.String raCol,
                               java.lang.String decCol,
                               AngleUnits units,
                               java.lang.String cols,
                               java.lang.String where)
                        throws java.sql.SQLException
        Constructor.
        Parameters:
        connection - live connection to database
        tableName - name of a table in the database to search
        raCol - name of table column containing right ascension
        decCol - name of table column containing declination
        units - angular units used by ra and dec columns
        cols - list of column names for the SELECT statement
        where - additional WHERE clause constraints
        Throws:
        java.sql.SQLException
    • Method Detail

      • executeQuery

        public abstract java.sql.ResultSet executeQuery​(double ra,
                                                        double dec,
                                                        double sr)
                                                 throws java.sql.SQLException
        Returns an SQL ResultSet containing the records corresponding to a cone search with the given parameters. This may return a superset of the records in the given cone - it is essential to use SQL which is simple (that is portable and hopefully optimisable).
        Parameters:
        ra - right ascension of cone centre in degrees
        dec - declination of cone centre in degrees
        sr - search radius of cone in degrees
        Returns:
        ResultSet containing records in cone (and possible some more)
        Throws:
        java.sql.SQLException
      • createSelector

        public static ConeSelector createSelector​(java.sql.Connection connection,
                                                  java.lang.String tableName,
                                                  java.lang.String raCol,
                                                  java.lang.String decCol,
                                                  AngleUnits units,
                                                  java.lang.String cols,
                                                  java.lang.String where,
                                                  boolean usePrepared)
                                           throws java.sql.SQLException
        Returns a new selector object which just queries on RA and Dec values. You can choose an implementation which uses PreparedStatements or not - there may be (big) performance implications.
        Parameters:
        connection - live connection to database
        tableName - name of a table in the database to search
        raCol - name of table column containing right ascension
        decCol - name of table column containing declination
        units - angular units used by ra and dec columns
        cols - list of column names for the SELECT statement
        where - additional WHERE clause constraints
        usePrepared - true to use JDBC PreparedStatements, false for normal Statements
        Throws:
        java.sql.SQLException
      • createTiledSelector

        public static ConeSelector createTiledSelector​(java.sql.Connection connection,
                                                       java.lang.String tableName,
                                                       java.lang.String raCol,
                                                       java.lang.String decCol,
                                                       AngleUnits units,
                                                       java.lang.String cols,
                                                       java.lang.String where,
                                                       java.lang.String tileCol,
                                                       SkyTiling tiling,
                                                       boolean usePrepared)
                                                throws java.sql.SQLException
        Returns a new selector object which queries using RA, Dec and a spatial tiling value. You can choose an implementation which uses PreparedStatements or not - there may be (big) performance implications.
        Parameters:
        connection - live connection to database
        tableName - name of a table in the database to search
        raCol - name of table column containing right ascension
        decCol - name of table column containing declination
        units - angular units used by ra and dec columns
        cols - list of column names for the SELECT statement
        where - additional WHERE clause constraints
        tileCol - column containing a sky tiling index value
        tiling - tiling scheme used by tileCol column
        usePrepared - true to use JDBC PreparedStatements, false for normal Statements
        Throws:
        java.sql.SQLException