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 class
JdbcLob.LobPipedOutputStream
static class
JdbcLob.State
State of the object.
-
Field Summary
Fields Modifier and Type Field Description (package private) JdbcConnection
conn
JDBC connection.(package private) JdbcLob.State
state
State.(package private) Value
value
Value.-
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) void
checkClosed()
Check that connection and LOB is not closed, otherwise throws exception with error codeErrorCode.OBJECT_CLOSED
.(package private) void
checkEditable()
Check the state of the LOB and throws the exception when check failed (set is supported only for a new LOB).(package private) void
checkReadable()
Check the state of the LOB and throws the exception when check failed (the LOB must be set completely before read).(package private) void
completeWrite(Value blob)
Change the state LOB state (LOB value is set completely and available to read).void
free()
Release all resources of this object.(package private) java.io.InputStream
getBinaryStream()
Returns the input stream.(package private) java.io.Reader
getCharacterStream()
Returns the reader.(package private) java.io.Writer
setCharacterStreamImpl()
Returns the writer.(package private) JdbcLob.LobPipedOutputStream
setClobOutputStreamImpl()
Returns the writer stream.java.lang.String
toString()
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.IOException
Check 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.SQLException
Returns the input stream.- Returns:
- the input stream
- Throws:
java.sql.SQLException
- on failure
-
getCharacterStream
java.io.Reader getCharacterStream() throws java.sql.SQLException
Returns the reader.- Returns:
- the reader
- Throws:
java.sql.SQLException
- on failure
-
setCharacterStreamImpl
java.io.Writer setCharacterStreamImpl() throws java.io.IOException
Returns 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:
toString
in classjava.lang.Object
-
-