Class EXTDTAInputStream
java.lang.Object
java.io.InputStream
org.apache.derby.impl.drda.EXTDTAInputStream
- All Implemented Interfaces:
Closeable, AutoCloseable
EXTDTAObjectHolder provides Externalized Large Object representation that
does not hold locks until the end of the transaction (DERBY-255)
It serves as a holder for lob data and is only valid as long as the original
result set from which it came is on the same row.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Blobprivate Clobprivate InputStream(package private) intColumn index starting with 1(package private) intDRDA Type of column/parameter(package private) EngineResultSetResultSet that contains the stream -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateEXTDTAInputStream(Blob blob, int ndrdaType) privateEXTDTAInputStream(Clob clob, int ndrdaType) privateEXTDTAInputStream(ResultSet rs, int columnNumber, int ndrdaType) -
Method Summary
Modifier and TypeMethodDescriptionintprivate static voidbadDRDAType(int drdaType) voidclose()booleanprotected voidfinalize()private InputStreamprivate Readerstatic EXTDTAInputStreamgetEXTDTAStream(CallableStatement cs, int column, int drdaType) Create a new EXTDTAInputStream from a CallableStatement.static EXTDTAInputStreamgetEXTDTAStream(ResultSet rs, int column, int drdaType) Create a new EXTDTAInputStream.inthashCode()voidThis method takes information of ResultSet and initializes the binaryInputStream variable of this object with not empty stream by calling getBinaryStream or getCharacterStream() as appropriate.protected booleanbooleanisNull()Is the value null?private longlength()voidmark(int arg0) booleanintread()RequiresinitInputStream()be called before we can read from the streamintread(byte[] arg0) intread(byte[] arg0, int arg1, int arg2) voidreset()longskip(long arg0) Methods inherited from class InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
binaryInputStream
-
ndrdaType
int ndrdaTypeDRDA Type of column/parameter -
rs
ResultSet that contains the stream -
columnNumber
int columnNumberColumn index starting with 1 -
_clob
-
_blob
-
-
Constructor Details
-
EXTDTAInputStream
-
EXTDTAInputStream
-
EXTDTAInputStream
-
-
Method Details
-
getEXTDTAStream
Create a new EXTDTAInputStream. Before read the stream must be initialized by the user withinitInputStream()- Parameters:
rs- result set from which to retrieve the lobcolumn- column numberdrdaType- FD:OCA type of object one of DRDAConstants.DRDA_TYPE_NLOBBYTES DRDAConstants.DRDA_TYPE_LOBBYTES DRDAConstants.DRDA_TYPE_NLOBCMIXED DRDAConstants.DRDA_TYPE_LOBCMIXED- Returns:
- null if the value is null or a new EXTDTAInputStream corresponding to rs.getBinaryStream(column) value and associated length
- Throws:
SQLException- See Also:
-
getEXTDTAStream
public static EXTDTAInputStream getEXTDTAStream(CallableStatement cs, int column, int drdaType) throws SQLException Create a new EXTDTAInputStream from a CallableStatement.- Parameters:
cs- CallableStatement from which to retrieve the lobcolumn- column numberdrdaType- FD:OCA type of object one of DRDAConstants.DRDA_TYPE_NLOBBYTES DRDAConstants.DRDA_TYPE_LOBBYTES DRDAConstants.DRDA_TYPE_NLOBCMIXED DRDAConstants.DRDA_TYPE_LOBCMIXED- Throws:
SQLException
-
read
RequiresinitInputStream()be called before we can read from the stream- Specified by:
readin classInputStream- Throws:
IOException- See Also:
-
available
- Overrides:
availablein classInputStream- Throws:
IOException- See Also:
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException- See Also:
-
equals
-
hashCode
-
mark
public void mark(int arg0) - Overrides:
markin classInputStream- See Also:
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream- See Also:
-
read
- Overrides:
readin classInputStream- Throws:
IOException- See Also:
-
read
- Overrides:
readin classInputStream- Throws:
IOException- See Also:
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException- See Also:
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException- See Also:
-
isEmptyStream
- Throws:
SQLException
-
length
- Throws:
SQLException
-
initInputStream
This method takes information of ResultSet and initializes the binaryInputStream variable of this object with not empty stream by calling getBinaryStream or getCharacterStream() as appropriate. The Reader returned from getCharacterStream() will be encoded in binarystream.- Throws:
SQLException
-
getBinaryStream
- Throws:
SQLException
-
getCharacterStream
- Throws:
SQLException
-
badDRDAType
private static void badDRDAType(int drdaType) -
finalize
-
isNull
Is the value null? Null status is obtained from the underlying EngineResultSet or LOB, so that it can be determined before the stream is retrieved.- Returns:
- true if this value is null
- Throws:
SQLException
-