Interface RemoteResultSetCursor<T>

  • Type Parameters:
    T - the type
    All Superinterfaces:
    java.rmi.Remote, org.tentackle.dbms.rmi.RemoteDelegate
    All Known Implementing Classes:
    RemoteResultSetCursorImpl

    public interface RemoteResultSetCursor<T>
    extends org.tentackle.dbms.rmi.RemoteDelegate
    Remote delegate interface for ResultSetCursor.
    Author:
    harald
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int afterLast()
      Positions the cursor after the last row.
      Works even for empty cursors.
      void beforeFirst()
      Positions the cursor before the first row.
      Works even for empty cursors.
      void close()
      Closes the scrollable resource.
      The scrollable resource is opened in its constructor.
      ResultSetCursor.FetchList<T> fetch()
      Fetches the next objects up to the fetchsize.
      This method is provided to minimize the number of roundtrips especially for remote cursors.
      boolean first()
      Rewinds the cursor to the first row.
      T get()
      Gets the data object of the current row.
      int getFetchDirection()
      Gets the fetch direction.
      int getFetchSize()
      Gets the fetchsize.
      boolean isAfterLast()
      Checks whether the cursor is after the last row.
      int last()
      Positions the cursor on the last row.
      boolean next()
      Moves the cursor to the next row.
      boolean previous()
      Moves the cursor to the previous row.
      int scroll​(int rows)
      Moves the cursor a given number of rows.
      void setFetchDirection​(int direction)
      Sets the fetch direction.
      void setFetchSize​(int rows)
      Sets the fetchsize.
      This is the number of rows the cursor will fetch from the server in one batch.
      int setRow​(int row)
      Sets the cursor to a given row.
      Row numbers start at 1.
      java.util.List<T> toList()
      Returns the objects of this cursor as a list.
    • Method Detail

      • close

        void close()
            throws java.rmi.RemoteException
        Closes the scrollable resource.
        The scrollable resource is opened in its constructor. Closing an already closed scrollable resource is allowed.
        Throws:
        java.rmi.RemoteException - if failed
      • setRow

        int setRow​(int row)
            throws java.rmi.RemoteException
        Sets the cursor to a given row.
        Row numbers start at 1.
        Parameters:
        row - the row number (must be ≥ 0)
        Returns:
        the new row number
        Throws:
        java.rmi.RemoteException - if failed
      • first

        boolean first()
               throws java.rmi.RemoteException
        Rewinds the cursor to the first row.
        Returns:
        true if rewound, false if cursor is empty
        Throws:
        java.rmi.RemoteException - if failed
      • last

        int last()
          throws java.rmi.RemoteException
        Positions the cursor on the last row.
        Returns:
        the current row
        Throws:
        java.rmi.RemoteException - if failed
      • next

        boolean next()
              throws java.rmi.RemoteException
        Moves the cursor to the next row. If there are no more rows the current row remains unchanged.
        Returns:
        true if moved, false if no more rows
        Throws:
        java.rmi.RemoteException - if failed
      • previous

        boolean previous()
                  throws java.rmi.RemoteException
        Moves the cursor to the previous row. If we are already at the beginning, the cursor remains unchanged.
        Returns:
        true if advanced, false if already at the beginning
        Throws:
        java.rmi.RemoteException - if failed
      • scroll

        int scroll​(int rows)
            throws java.rmi.RemoteException
        Moves the cursor a given number of rows.
        Parameters:
        rows - the number of rows to move, negative to move backwards
        Returns:
        the current row
        Throws:
        java.rmi.RemoteException - if failed
      • beforeFirst

        void beforeFirst()
                  throws java.rmi.RemoteException
        Positions the cursor before the first row.
        Works even for empty cursors.
        Throws:
        java.rmi.RemoteException - if failed
      • afterLast

        int afterLast()
               throws java.rmi.RemoteException
        Positions the cursor after the last row.
        Works even for empty cursors.
        Returns:
        the current row
        Throws:
        java.rmi.RemoteException - if failed
      • isAfterLast

        boolean isAfterLast()
                     throws java.rmi.RemoteException
        Checks whether the cursor is after the last row.
        Returns:
        true if after last
        Throws:
        java.rmi.RemoteException - if failed
      • get

        T get()
        throws java.rmi.RemoteException
        Gets the data object of the current row.
        Returns:
        the object, null if invalid row or no such object
        Throws:
        java.rmi.RemoteException - if failed
      • toList

        java.util.List<T> toList()
                          throws java.rmi.RemoteException
        Returns the objects of this cursor as a list.
        Returns:
        the list
        Throws:
        java.rmi.RemoteException - if failed
      • setFetchSize

        void setFetchSize​(int rows)
                   throws java.rmi.RemoteException
        Sets the fetchsize.
        This is the number of rows the cursor will fetch from the server in one batch. A fetchsize of 0 means server default.
        Parameters:
        rows - the fetchsize
        Throws:
        java.rmi.RemoteException - if failed
      • getFetchSize

        int getFetchSize()
                  throws java.rmi.RemoteException
        Gets the fetchsize.
        Returns:
        the fetchsize
        Throws:
        java.rmi.RemoteException - if failed
      • setFetchDirection

        void setFetchDirection​(int direction)
                        throws java.rmi.RemoteException
        Sets the fetch direction.
        Parameters:
        direction - the direction, see ResultSet.setFetchDirection(int)
        Throws:
        java.rmi.RemoteException - if failed
      • getFetchDirection

        int getFetchDirection()
                       throws java.rmi.RemoteException
        Gets the fetch direction.
        Returns:
        the direction
        Throws:
        java.rmi.RemoteException - if failed
      • fetch

        ResultSetCursor.FetchList<T> fetch()
                                    throws java.rmi.RemoteException
        Fetches the next objects up to the fetchsize.
        This method is provided to minimize the number of roundtrips especially for remote cursors. The cursor is closed at the end of the cursor.
        Returns:
        the list of objects, null if no more objects found
        Throws:
        java.rmi.RemoteException - if failed