Package org.h2.jdbc
Class JdbcClob
- java.lang.Object
-
- org.h2.message.TraceObject
-
- org.h2.jdbc.JdbcLob
-
- org.h2.jdbc.JdbcClob
-
- All Implemented Interfaces:
java.sql.Clob,java.sql.NClob
public final class JdbcClob extends JdbcLob implements java.sql.NClob
Represents a CLOB value.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.h2.jdbc.JdbcLob
JdbcLob.LobPipedOutputStream, 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, Value value, JdbcLob.State state, int id)INTERNAL
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStreamgetAsciiStream()Returns the input stream.java.io.ReadergetCharacterStream()Returns the reader.java.io.ReadergetCharacterStream(long pos, long length)Returns the reader, starting from an offset.java.lang.StringgetSubString(long pos, int length)Returns a substring.longlength()Returns the length.longposition(java.lang.String pattern, long start)[Not supported] Searches a pattern and return the position.longposition(java.sql.Clob clobPattern, long start)[Not supported] Searches a pattern and return the position.java.io.OutputStreamsetAsciiStream(long pos)[Not supported] Returns an output stream.java.io.WritersetCharacterStream(long pos)Get a writer to update the Clob.intsetString(long pos, java.lang.String str)Fills the Clob.intsetString(long pos, java.lang.String str, int offset, int len)Fills the Clob.voidtruncate(long len)[Not supported] Truncates the object.-
Methods inherited from class org.h2.jdbc.JdbcLob
checkClosed, checkEditable, checkReadable, completeWrite, free, getBinaryStream, setCharacterStreamImpl, setClobOutputStreamImpl, 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
-
-
-
-
Constructor Detail
-
JdbcClob
public JdbcClob(JdbcConnection conn, Value value, JdbcLob.State state, int id)
INTERNAL- Parameters:
conn- it belongs tovalue- ofstate- of the LOBid- of the trace object
-
-
Method Detail
-
length
public long length() throws java.sql.SQLExceptionReturns the length.- Specified by:
lengthin interfacejava.sql.Clob- Returns:
- the length
- Throws:
java.sql.SQLException
-
truncate
public void truncate(long len) throws java.sql.SQLException[Not supported] Truncates the object.- Specified by:
truncatein interfacejava.sql.Clob- Throws:
java.sql.SQLException
-
getAsciiStream
public java.io.InputStream getAsciiStream() throws java.sql.SQLExceptionReturns the input stream.- Specified by:
getAsciiStreamin interfacejava.sql.Clob- Returns:
- the input stream
- Throws:
java.sql.SQLException
-
setAsciiStream
public java.io.OutputStream setAsciiStream(long pos) throws java.sql.SQLException[Not supported] Returns an output stream.- Specified by:
setAsciiStreamin interfacejava.sql.Clob- Throws:
java.sql.SQLException
-
getCharacterStream
public java.io.Reader getCharacterStream() throws java.sql.SQLExceptionDescription copied from class:JdbcLobReturns the reader.- Specified by:
getCharacterStreamin interfacejava.sql.Clob- Overrides:
getCharacterStreamin classJdbcLob- Returns:
- the reader
- Throws:
java.sql.SQLException- on failure
-
setCharacterStream
public java.io.Writer setCharacterStream(long pos) throws java.sql.SQLExceptionGet 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:
setCharacterStreamin interfacejava.sql.Clob- Parameters:
pos- where to start writing (the first character is at position 1)- Returns:
- a writer
- Throws:
java.sql.SQLException
-
getSubString
public java.lang.String getSubString(long pos, int length) throws java.sql.SQLExceptionReturns a substring.- Specified by:
getSubStringin interfacejava.sql.Clob- Parameters:
pos- the position (the first character is at position 1)length- the number of characters- Returns:
- the string
- Throws:
java.sql.SQLException
-
setString
public int setString(long pos, java.lang.String str) throws java.sql.SQLExceptionFills 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:
setStringin interfacejava.sql.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:
java.sql.SQLException- on failure
-
setString
public int setString(long pos, java.lang.String str, int offset, int len) throws java.sql.SQLExceptionFills 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:
setStringin interfacejava.sql.Clob- Parameters:
pos- where to start writing (the first character is at position 1)str- the string to addoffset- the string offsetlen- the number of characters to read- Returns:
- the length of the added text
- Throws:
java.sql.SQLException
-
position
public long position(java.lang.String pattern, long start) throws java.sql.SQLException[Not supported] Searches a pattern and return the position.- Specified by:
positionin interfacejava.sql.Clob- Throws:
java.sql.SQLException
-
position
public long position(java.sql.Clob clobPattern, long start) throws java.sql.SQLException[Not supported] Searches a pattern and return the position.- Specified by:
positionin interfacejava.sql.Clob- Throws:
java.sql.SQLException
-
getCharacterStream
public java.io.Reader getCharacterStream(long pos, long length) throws java.sql.SQLExceptionReturns the reader, starting from an offset.- Specified by:
getCharacterStreamin interfacejava.sql.Clob- Parameters:
pos- 1-based offsetlength- length of requested area- Returns:
- the reader
- Throws:
java.sql.SQLException
-
-