Package org.h2.jdbc
Class JdbcLob
- java.lang.Object
-
- org.h2.message.TraceObject
-
- org.h2.jdbc.JdbcLob
-
- Direct Known Subclasses:
JdbcBlob,JdbcClob,JdbcSQLXML
public abstract class JdbcLob extends TraceObject
Represents a large object value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classJdbcLob.LobPipedOutputStreamstatic classJdbcLob.StateState of the object.
-
Field Summary
Fields Modifier and Type Field Description (package private) JdbcConnectionconnJDBC connection.(package private) JdbcLob.StatestateState.(package private) ValuevalueValue.-
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 JdbcLob(JdbcConnection conn, Value value, JdbcLob.State state, int type, int id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcheckClosed()Check that connection and LOB is not closed, otherwise throws exception with error codeErrorCode.OBJECT_CLOSED.(package private) voidcheckEditable()Check the state of the LOB and throws the exception when check failed (set is supported only for a new LOB).(package private) voidcheckReadable()Check the state of the LOB and throws the exception when check failed (the LOB must be set completely before read).(package private) voidcompleteWrite(Value blob)Change the state LOB state (LOB value is set completely and available to read).voidfree()Release all resources of this object.(package private) java.io.InputStreamgetBinaryStream()Returns the input stream.(package private) java.io.ReadergetCharacterStream()Returns the reader.(package private) java.io.WritersetCharacterStreamImpl()Returns the writer.(package private) JdbcLob.LobPipedOutputStreamsetClobOutputStreamImpl()Returns the writer stream.java.lang.StringtoString()INTERNAL-
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
-
-
-
-
Field Detail
-
conn
final JdbcConnection conn
JDBC connection.
-
value
Value value
Value.
-
state
JdbcLob.State state
State.
-
-
Constructor Detail
-
JdbcLob
JdbcLob(JdbcConnection conn, Value value, JdbcLob.State state, int type, int id)
-
-
Method Detail
-
checkClosed
void checkClosed()
Check that connection and LOB is not closed, otherwise throws exception with error codeErrorCode.OBJECT_CLOSED.
-
checkEditable
void checkEditable()
Check the state of the LOB and throws the exception when check failed (set is supported only for a new LOB).
-
checkReadable
void checkReadable() throws java.sql.SQLException, java.io.IOExceptionCheck the state of the LOB and throws the exception when check failed (the LOB must be set completely before read).- Throws:
java.sql.SQLException- on SQL exceptionjava.io.IOException- on I/O exception
-
completeWrite
void completeWrite(Value blob)
Change the state LOB state (LOB value is set completely and available to read).- Parameters:
blob- LOB value.
-
free
public void free()
Release all resources of this object.
-
getBinaryStream
java.io.InputStream getBinaryStream() throws java.sql.SQLExceptionReturns the input stream.- Returns:
- the input stream
- Throws:
java.sql.SQLException- on failure
-
getCharacterStream
java.io.Reader getCharacterStream() throws java.sql.SQLExceptionReturns the reader.- Returns:
- the reader
- Throws:
java.sql.SQLException- on failure
-
setCharacterStreamImpl
java.io.Writer setCharacterStreamImpl() throws java.io.IOExceptionReturns the writer.- Returns:
- Writer.
- Throws:
java.io.IOException- If an I/O error occurs.
-
setClobOutputStreamImpl
JdbcLob.LobPipedOutputStream setClobOutputStreamImpl() throws java.io.IOException
Returns the writer stream.- Returns:
- Output stream..
- Throws:
java.io.IOException- If an I/O error occurs.
-
toString
public java.lang.String toString()
INTERNAL- Overrides:
toStringin classjava.lang.Object
-
-