Package org.h2.jdbc

Class JdbcClob

java.lang.Object
org.h2.message.TraceObject
org.h2.jdbc.JdbcLob
org.h2.jdbc.JdbcClob
All Implemented Interfaces:
Clob, NClob

public final class JdbcClob extends JdbcLob implements NClob
Represents a CLOB value.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.h2.jdbc.JdbcLob

    JdbcLob.State
  • Field Summary

    Fields inherited from class org.h2.message.TraceObject

    ARRAY, BLOB, CALLABLE_STATEMENT, CLOB, CONNECTION, DATA_SOURCE, DATABASE_META_DATA, PARAMETER_META_DATA, PREPARED_STATEMENT, RESULT_SET, RESULT_SET_META_DATA, SAVEPOINT, SQLXML, STATEMENT, trace, XA_DATA_SOURCE, XID
  • Constructor Summary

    Constructors
    Constructor
    Description
    JdbcClob(JdbcConnection conn, org.h2.value.Value value, JdbcLob.State state, int id)
    INTERNAL
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the input stream.
     
    getCharacterStream(long pos, long length)
    Returns the reader, starting from an offset.
    getSubString(long pos, int length)
    Returns a substring.
    long
    Returns the length.
    long
    position(String pattern, long start)
    [Not supported] Searches a pattern and return the position.
    long
    position(Clob clobPattern, long start)
    [Not supported] Searches a pattern and return the position.
    setAsciiStream(long pos)
    [Not supported] Returns an output stream.
    Get a writer to update the Clob.
    int
    setString(long pos, String str)
    Fills the Clob.
    int
    setString(long pos, String str, int offset, int len)
    Fills the Clob.
    void
    truncate(long len)
    [Not supported] Truncates the object.

    Methods inherited from class org.h2.jdbc.JdbcLob

    free, toString

    Methods inherited from class org.h2.message.TraceObject

    debugCode, debugCodeAssign, debugCodeCall, debugCodeCall, debugCodeCall, getNextId, getTraceId, getTraceObjectName, isDebugEnabled, isInfoEnabled, logAndConvert, quote, quoteArray, quoteBigDecimal, quoteBytes, quoteDate, quoteIntArray, quoteMap, quoteTime, quoteTimestamp, setTrace, unsupported

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface java.sql.Clob

    free
  • Constructor Details

    • JdbcClob

      public JdbcClob(JdbcConnection conn, org.h2.value.Value value, JdbcLob.State state, int id)
      INTERNAL
      Parameters:
      conn - it belongs to
      value - of
      state - of the LOB
      id - of the trace object
  • Method Details

    • length

      public long length() throws SQLException
      Returns the length.
      Specified by:
      length in interface Clob
      Returns:
      the length
      Throws:
      SQLException
    • truncate

      public void truncate(long len) throws SQLException
      [Not supported] Truncates the object.
      Specified by:
      truncate in interface Clob
      Throws:
      SQLException
    • getAsciiStream

      public InputStream getAsciiStream() throws SQLException
      Returns the input stream.
      Specified by:
      getAsciiStream in interface Clob
      Returns:
      the input stream
      Throws:
      SQLException
    • setAsciiStream

      public OutputStream setAsciiStream(long pos) throws SQLException
      [Not supported] Returns an output stream.
      Specified by:
      setAsciiStream in interface Clob
      Throws:
      SQLException
    • getCharacterStream

      public Reader getCharacterStream() throws SQLException
      Specified by:
      getCharacterStream in interface Clob
      Throws:
      SQLException
    • setCharacterStream

      public Writer setCharacterStream(long pos) throws SQLException
      Get a writer to update the Clob. This is only supported for new, empty Clob objects that were created with Connection.createClob() or createNClob(). The Clob is created in a separate thread, and the object is only updated when Writer.close() is called. The position must be 1, meaning the whole Clob data is set.
      Specified by:
      setCharacterStream in interface Clob
      Parameters:
      pos - where to start writing (the first character is at position 1)
      Returns:
      a writer
      Throws:
      SQLException
    • getSubString

      public String getSubString(long pos, int length) throws SQLException
      Returns a substring.
      Specified by:
      getSubString in interface Clob
      Parameters:
      pos - the position (the first character is at position 1)
      length - the number of characters
      Returns:
      the string
      Throws:
      SQLException
    • setString

      public int setString(long pos, String str) throws SQLException
      Fills the Clob. This is only supported for new, empty Clob objects that were created with Connection.createClob() or createNClob(). The position must be 1, meaning the whole Clob data is set.
      Specified by:
      setString in interface Clob
      Parameters:
      pos - where to start writing (the first character is at position 1)
      str - the string to add
      Returns:
      the length of the added text
      Throws:
      SQLException - on failure
    • setString

      public int setString(long pos, String str, int offset, int len) throws SQLException
      Fills the Clob. This is only supported for new, empty Clob objects that were created with Connection.createClob() or createNClob(). The position must be 1, meaning the whole Clob data is set.
      Specified by:
      setString in interface Clob
      Parameters:
      pos - where to start writing (the first character is at position 1)
      str - the string to add
      offset - the string offset
      len - the number of characters to read
      Returns:
      the length of the added text
      Throws:
      SQLException
    • position

      public long position(String pattern, long start) throws SQLException
      [Not supported] Searches a pattern and return the position.
      Specified by:
      position in interface Clob
      Throws:
      SQLException
    • position

      public long position(Clob clobPattern, long start) throws SQLException
      [Not supported] Searches a pattern and return the position.
      Specified by:
      position in interface Clob
      Throws:
      SQLException
    • getCharacterStream

      public Reader getCharacterStream(long pos, long length) throws SQLException
      Returns the reader, starting from an offset.
      Specified by:
      getCharacterStream in interface Clob
      Parameters:
      pos - 1-based offset
      length - length of requested area
      Returns:
      the reader
      Throws:
      SQLException