Class InternalToolResultSet

    • Constructor Detail

      • InternalToolResultSet

        public InternalToolResultSet​(com.redwood.scheduler.api.model.SchedulerSession newSession)
    • Method Detail

      • postExecute

        public void postExecute​(ResultSet rs)
                         throws SQLException
        Description copied from interface: APIResultSetPostExecuteCallback
        Process the result set before the initial ResultSet.next() is called. This should be used to handle the cases where the result set is empty but result information is still required - e.g. displaying the headers for an empty result.
        Specified by:
        postExecute in interface APIResultSetPostExecuteCallback
        Parameters:
        rs - the ResultSet row to process
        Throws:
        SQLException - if an error occurs.
      • callback

        public boolean callback​(ResultSet rs,
                                ObjectGetter ignored)
                         throws SQLException
        Description copied from interface: APIResultSetCallback
        Invoked for each result, provided that the previous invocation returned true.
        Specified by:
        callback in interface APIResultSetCallback
        Parameters:
        rs - the result-set to process
        ignored - an object-getter with can be used to convert the result-set into one (or more) objects.
        Returns:
        true if this method should be invoked for the next result, false if subsequent results are to be discarded.
        Throws:
        SQLException - Exception thrown when a database-related error occurs
      • next

        public boolean next()
        Description copied from interface: ToolResultSet
        Attempt to moves to the next row, and return true if that row exists. The ToolResultSet starts before the first row. The first call to the method makes the first row curent, the second call makes the second row current, and so on. Example usage:
         import com.redwood.scheduler.api.tool.*;
        
         public class Main
         {
           public static void main(String [] args)
           throws Exception
           {
             ToolConnection con = ToolConnectionFactory.createConnection(args[0], 60000);
             ToolResultSet rs = con.executeQuery("select JobDefinition.Name, JobDefinition.UniqueId from JobDefinition", null, null);
             while (rs.next())
             {
               System.out.println(rs.getString(1) + " = " + rs.getString(2));
             }
           }
         }
        
         
        Specified by:
        next in interface ToolResultSet
        Returns:
        true if the new current row is valid, or false if there are no more rows.
      • getLong

        public Long getLong​(int columnIndex)
        Description copied from interface: ToolResultSet
        Get the value of the specified column as a Long, columns start at 1.
        Specified by:
        getLong in interface ToolResultSet
        Parameters:
        columnIndex - the column index, 1 based.
        Returns:
        the value of the column, as a Long.
      • getBigDecimal

        public BigDecimal getBigDecimal​(int columnIndex)
        Description copied from interface: ToolResultSet
        Get the value of the specified column as a BigDecimal, columns start at 1.
        Specified by:
        getBigDecimal in interface ToolResultSet
        Parameters:
        columnIndex - the column index, 1 based.
        Returns:
        the value of the column, as a BigDecimal.
      • getString

        public String getString​(int columnIndex)
        Description copied from interface: ToolResultSet
        Get the value of the specified column as a String, columns start at 1.
        Specified by:
        getString in interface ToolResultSet
        Parameters:
        columnIndex - the column index, 1 based.
        Returns:
        the value of the column, as a String.
      • close

        public void close()
        Description copied from interface: ToolResultSet
        Close the ToolResultSet, this is not required, but will free memory used to hold the data set.
        Specified by:
        close in interface ToolResultSet