org.firebirdsql.jdbc

## Class FBClob

- java.lang.Object
- - org.firebirdsql.jdbc.FBClob

- All Implemented Interfaces:
    java.sql.Clob, java.sql.NClob

      public final class FBClob
      extends java.lang.Object
      implements java.sql.Clob, java.sql.NClob

  Implementation of `Clob`.

  This class also implements `NClob` so it can be used with the `set/get/updateNClob` methods transparently. It technically does not conform to the JDBC requirements for `NClob`.

  Author:
    David Jencks

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FBClob(FBBlob blob)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `copyCharacterStream(java.io.Reader characterStream)` Copy data from a character stream into this Blob.
    `void` | `copyCharacterStream(java.io.Reader characterStream, long length)` Copy data from a character stream into this Blob.
    `void` | `free()`
    `java.io.InputStream` | `getAsciiStream()`
    `java.io.Reader` | `getCharacterStream()`
    `java.io.Reader` | `getCharacterStream(long pos, long length)`
    `java.lang.String` | `getSubString(long pos, int length)`
    `FBBlob` | `getWrappedBlob()` Retrieves the FBBlob wrapped by this FBClob.
    `long` | `length()`
    `long` | `position(java.sql.Clob searchstr, long start)`
    `long` | `position(java.lang.String searchstr, long start)`
    `java.io.OutputStream` | `setAsciiStream(long pos)`
    `java.io.Writer` | `setCharacterStream(long pos)`
    `int` | `setString(long pos, java.lang.String str)`
    `int` | `setString(long pos, java.lang.String str, int offset, int len)`
    `void` | `truncate(long len)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FBClob

          public FBClob(FBBlob blob)

  - ### Method Detail

    - #### length

          public long length()
                      throws java.sql.SQLException

      Specified by:
        `length` in interface `java.sql.Clob`
      Throws:
        `java.sql.SQLException`

    - #### truncate

          public void truncate(long len)
                        throws java.sql.SQLException

      This operation is not currently supported

      Specified by:
        `truncate` in interface `java.sql.Clob`
      Throws:
        `java.sql.SQLException`

    - #### getSubString

          public java.lang.String getSubString(long pos,
                                               int length)
                                        throws java.sql.SQLException

      Specified by:
        `getSubString` in interface `java.sql.Clob`
      Throws:
        `java.sql.SQLException`

    - #### getCharacterStream

          public java.io.Reader getCharacterStream()
                                            throws java.sql.SQLException

      Specified by:
        `getCharacterStream` in interface `java.sql.Clob`
      Throws:
        `java.sql.SQLException`

    - #### getAsciiStream

          public java.io.InputStream getAsciiStream()
                                             throws java.sql.SQLException

      Specified by:
        `getAsciiStream` in interface `java.sql.Clob`
      Throws:
        `java.sql.SQLException`

    - #### position

          public long position(java.lang.String searchstr,
                               long start)
                        throws java.sql.SQLException

      Jaybird currently does not support this method.

      Specified by:
        `position` in interface `java.sql.Clob`
      Throws:
        `java.sql.SQLException`

    - #### position

          public long position(java.sql.Clob searchstr,
                               long start)
                        throws java.sql.SQLException

      Jaybird currently does not support this method.

      Specified by:
        `position` in interface `java.sql.Clob`
      Throws:
        `java.sql.SQLException`

    - #### setString

          public int setString(long pos,
                               java.lang.String str)
                        throws java.sql.SQLException

      Jaybird currently only supports this method for `position == 1`.

      Specified by:
        `setString` in interface `java.sql.Clob`
      Throws:
        `java.sql.SQLException`

    - #### setString

          public int setString(long pos,
                               java.lang.String str,
                               int offset,
                               int len)
                        throws java.sql.SQLException

      Jaybird currently only supports this method for `position == 1`.

      Specified by:
        `setString` in interface `java.sql.Clob`
      Throws:
        `java.sql.SQLException`

    - #### setAsciiStream

          public java.io.OutputStream setAsciiStream(long pos)
                                              throws java.sql.SQLException

      Specified by:
        `setAsciiStream` in interface `java.sql.Clob`
      Throws:
        `java.sql.SQLException`

    - #### setCharacterStream

          public java.io.Writer setCharacterStream(long pos)
                                            throws java.sql.SQLException

      Specified by:
        `setCharacterStream` in interface `java.sql.Clob`
      Throws:
        `java.sql.SQLException`

    - #### free

          public void free()
                    throws java.sql.SQLException

      Specified by:
        `free` in interface `java.sql.Clob`
      Throws:
        `java.sql.SQLException`

    - #### getCharacterStream

          public java.io.Reader getCharacterStream(long pos,
                                                   long length)
                                            throws java.sql.SQLException

      Specified by:
        `getCharacterStream` in interface `java.sql.Clob`
      Throws:
        `java.sql.SQLException`

    - #### copyCharacterStream

          public void copyCharacterStream(java.io.Reader characterStream,
                                          long length)
                                   throws java.sql.SQLException

      Copy data from a character stream into this Blob.

      Calling with length `-1` is equivalent to calling `copyCharacterStream(Reader)`.

      Parameters:
        `characterStream` - the source of data to copy
        `length` - The maximum number of bytes to copy, or `-1` to read the whole stream
      Throws:
        `java.sql.SQLException`

    - #### copyCharacterStream

          public void copyCharacterStream(java.io.Reader characterStream)
                                   throws java.sql.SQLException

      Copy data from a character stream into this Blob.
      Parameters:
        `characterStream` - the source of data to copy
      Throws:
        `java.sql.SQLException`

    - #### getWrappedBlob

          public FBBlob getWrappedBlob()
                                throws java.sql.SQLException

      Retrieves the FBBlob wrapped by this FBClob.
      Returns:
        FBBlob instance
      Throws:
        `java.sql.SQLException`

Copyright © 2001-2025 Jaybird (Firebird JDBC) team. All rights reserved.