Interface SqlClob

  • All Superinterfaces:
    java.lang.AutoCloseable

    public interface SqlClob
    extends java.lang.AutoCloseable
    A reference to a CHARACTER LARGE OBJECT in the attached database.
    • Method Detail

      • closeOperation

        Operation<java.lang.Void> closeOperation()
        Return an Operation that will release the temporary resources associated with this SqlClob.
        Returns:
        an Operation that will release the temporary resources associated with this SqlClob.
      • close

        default void close()
        Specified by:
        close in interface java.lang.AutoCloseable
      • getPositionOperation

        Operation<java.lang.Long> getPositionOperation()
        Return a Operation that fetches the position of this SqlClob. Position 0 is immediately before the first char in the SqlClob. Position 1 is the first char in the SqlClob, etc. Position length() is the last char in the SqlClob. Position is between 0 and length + 1.
        Returns:
        an Operation that returns the position of this SqlClob
        Throws:
        java.lang.IllegalStateException - if the Session that created this SqlClob is closed.;
      • getPosition

        default java.util.concurrent.CompletionStage<java.lang.Long> getPosition()
        Get the position of this SqlClob. Position 0 is immediately before the first char in the SqlClob. Position 1 is the first char in the SqlClob, etc. Position length() is the last char in the SqlClob. Position is between 0 and length + 1. ISSUE: Should position be 1-based as SQL seems to do or 0-based as Java does?
        Returns:
        a future which value is the position of this SqlClob
        Throws:
        java.lang.IllegalStateException - if the Session that created this SqlClob is closed.
      • lengthOperation

        Operation<java.lang.Long> lengthOperation()
        Return a Operation that fetches the length of this SqlClob.
        Returns:
        a Operation that returns the length of this SqlClob
        Throws:
        java.lang.IllegalStateException - if the Session that created this SqlClob is closed.
      • length

        default java.util.concurrent.CompletionStage<java.lang.Long> length()
        Get the length of this SqlClob.
        Returns:
        a Future which value is the number of chars in this SqlClob
        Throws:
        java.lang.IllegalStateException - if the Session that created this SqlClob is closed.
      • setPositionOperation

        Operation<java.lang.Long> setPositionOperation​(long offset)
        Return an Operation that sets the position of this SqlClob. If offset exceeds the length of this SqlClob set position to the length + 1 of this SqlClob, ie one past the last char.
        Parameters:
        offset - a non-negative number
        Returns:
        a Operation that sets the position of this SqlClob
        Throws:
        java.lang.IllegalArgumentException - if offset is less than 0
        java.lang.IllegalStateException - if the Session that created this SqlClob is closed.
      • setPosition

        default SqlClob setPosition​(long offset)
        Set the position of this SqlClob. If offset exceeds the length of this SqlClob set position to the length + 1 of this SqlClob, ie one past the last char.
        Parameters:
        offset - the 1-based position to set
        Returns:
        this SqlClob
        Throws:
        java.lang.IllegalArgumentException - if offset is less than 0
        java.lang.IllegalStateException - if the Session that created this SqlClob is closed.
      • locateOperation

        Operation<java.lang.Long> locateOperation​(SqlClob target)
        Return an Operation to set the position to the beginning of the next occurrence of the target after the position. If there is no such occurrence set the position to 0.
        Parameters:
        target - a SqlClob created by the same Session containing the char sequence to search for
        Returns:
        an Operation that locates target in this SqlClob
        Throws:
        java.lang.IllegalArgumentException - if target was created by some other Session
        java.lang.IllegalStateException - if the Session that created this SqlClob is closed.
      • locate

        default SqlClob locate​(SqlClob target)
        Set the position to the beginning of the next occurrence of the target after the position. If there is no such occurrence set the position to 0.
        Parameters:
        target - the char sequence to search for
        Returns:
        this SqlClob
        Throws:
        java.lang.IllegalArgumentException - if target was created by some other Session
        java.lang.IllegalStateException - if the Session that created this SqlClob is closed
      • locateOperation

        Operation<java.lang.Long> locateOperation​(java.lang.CharSequence target)
        Return an Operation to set the position to the beginning of the next occurrence of the target after the position. If there is no such occurrence set the position to 0.
        Parameters:
        target - the char sequence to search for. Not null. Captured.
        Returns:
        an Operation that locates target in this SqlClob
        Throws:
        java.lang.IllegalStateException - if the Session that created this SqlClob is closed.
      • locate

        default SqlClob locate​(java.lang.CharSequence target)
        Set the position to the beginning of the next occurrence of the target after the position. If there is no such occurrence set the position to 0.
        Parameters:
        target - the char sequence to search for
        Returns:
        this SqlClob
        Throws:
        java.lang.IllegalStateException - if the Session that created this SqlClob is closed.
      • trimOperation

        Operation<java.lang.Long> trimOperation()
        Return an Operation that truncates this SqlClob so that the current position is the end of the SqlClob. If the position is N, then after trim() the length is N - 1. The position is still N. This will fail if position is 0.
        Returns:
        an Operation that trims the length of this SqlClob
        Throws:
        java.lang.IllegalStateException - if the Session that created this SqlClob is closed or position is 0.
      • trim

        default SqlClob trim()
        Truncate this SqlClob so that the current position is the end of the SqlClob. If the position is N, then after trim() the length is N - 1. The position is still N. This will fail if position is 0.
        Returns:
        this SqlClob
        Throws:
        java.lang.IllegalStateException - if the Session that created this SqlClob is closed or position is 0.
      • getReader

        java.io.Reader getReader()
        Returns a Reader for the characters in this SqlClob. Characters are read starting at the current position. Each character read advances the position by one. ISSUE: There is no character analog to AsynchronousByteChannel. It is trivial to construct a Reader from an AsynchronousByteChannel however.
        Returns:
        a Reader for the characters in this SqlClob
      • getWriter

        java.io.Writer getWriter()
        Returns a Writer for this SqlClob. Characters are written starting at the current position. Each character written advances the position by one. ISSUE: There is no character analog to AsynchronousByteChannel. It is trivial to construct a Writer from an AsynchronousByteChannel however.
        Returns:
        a Writer for the characters of this SqlClob