Interface ToolResultSet

  • All Known Implementing Classes:
    InternalToolResultSet

    public interface ToolResultSet
    A result set from a query. This interface is similar in intent to java.sql.ResultSet, but contains far fewer methods.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Close the ToolResultSet, this is not required, but will free memory used to hold the data set.
      BigDecimal getBigDecimal​(int columnIndex)
      Get the value of the specified column as a BigDecimal, columns start at 1.
      Long getLong​(int columnIndex)
      Get the value of the specified column as a Long, columns start at 1.
      ToolResultSetMetaData getMetaData()
      Get the metadata for the query.
      String getString​(int columnIndex)
      Get the value of the specified column as a String, columns start at 1.
      boolean next()
      Attempt to moves to the next row, and return true if that row exists.
    • Method Detail

      • getMetaData

        ToolResultSetMetaData getMetaData()
        Get the metadata for the query.
        Returns:
        the metadata.
      • next

        boolean next()
        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));
             }
           }
         }
        
         
        Returns:
        true if the new current row is valid, or false if there are no more rows.
      • getLong

        Long getLong​(int columnIndex)
        Get the value of the specified column as a Long, columns start at 1.
        Parameters:
        columnIndex - the column index, 1 based.
        Returns:
        the value of the column, as a Long.
      • getBigDecimal

        BigDecimal getBigDecimal​(int columnIndex)
        Get the value of the specified column as a BigDecimal, columns start at 1.
        Parameters:
        columnIndex - the column index, 1 based.
        Returns:
        the value of the column, as a BigDecimal.
      • getString

        String getString​(int columnIndex)
        Get the value of the specified column as a String, columns start at 1.
        Parameters:
        columnIndex - the column index, 1 based.
        Returns:
        the value of the column, as a String.
      • close

        void close()
        Close the ToolResultSet, this is not required, but will free memory used to hold the data set.