Package adams.db

Class Sequences

    • Constructor Detail

      • Sequences

        protected Sequences()
        Initializes the object.
    • Method Detail

      • refresh

        public abstract void refresh()
        Reloads the templates.
        Specified by:
        refresh in interface SequenceProvider
      • isTypeNumeric

        protected boolean isTypeNumeric​(int type)
        Checks whether the SQL type represents a numeric one.
        Parameters:
        type - the type to check
        Returns:
        true if numeric
        See Also:
        Types
      • isTypeDate

        protected boolean isTypeDate​(int type)
        Checks whether the SQL type represents a date/time/timestamp one.
        Parameters:
        type - the type to check
        Returns:
        true if date/time/timestamp
        See Also:
        Types
      • findColumn

        protected int findColumn​(ResultSet rs,
                                 String colName,
                                 boolean numeric)
        Returns the index of the column in the resultset.
        Parameters:
        rs - the resultset to use
        colName - the name of the column
        numeric - whether the column has to be numeric
        Returns:
        the index of the column, -1 if not found
      • filterColumns

        protected Hashtable<Integer,​Integer> filterColumns​(ResultSet rs)
        Filters the columns that can be displayed.
        Relation: Index <-> type (of SQL Types).
        Parameters:
        rs - the Resultset to analyze
        Returns:
        the relation
      • getColumnName

        protected String getColumnName​(ResultSet rs,
                                       int index)
        Returns the name of the column.
        Parameters:
        rs - the ResultSet to use
        index - the index (1-based) of the column
        Returns:
        the name, or null in case of error
      • getValue

        protected double getValue​(ResultSet rs,
                                  int index,
                                  int type)
        Returns the value at the specified index.
        Parameters:
        rs - the resultset to use
        index - the column index (1-based)
        type - the type of the column
        Returns:
        the value
      • retrieve

        public Vector<XYSequence> retrieve​(String query)
        Retrieves sequence(s) from a given SQL statement.
        Specified by:
        retrieve in interface SequenceProvider
        Parameters:
        query - the statement to retrieve the sequences
        Returns:
        the sequence(s)
      • retrieve

        public abstract Vector<XYSequence> retrieve​(String query,
                                                    String nameX)
        Retrieves sequence(s) from a given SQL statement.
        Specified by:
        retrieve in interface SequenceProvider
        Parameters:
        query - the statement to retrieve the sequences
        nameX - the name of the column to use as x-axis, if null then the first column will be used
        Returns:
        the sequence(s)