Package org.apache.derby.impl.drda
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 Blob
private Clob
private InputStream
(package private) int
Column index starting with 1(package private) int
DRDA Type of column/parameter(package private) EngineResultSet
ResultSet that contains the stream -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
EXTDTAInputStream
(Blob blob, int ndrdaType) private
EXTDTAInputStream
(Clob clob, int ndrdaType) private
EXTDTAInputStream
(ResultSet rs, int columnNumber, int ndrdaType) -
Method Summary
Modifier and TypeMethodDescriptionint
private static void
badDRDAType
(int drdaType) void
close()
boolean
protected void
finalize()
private InputStream
private Reader
static EXTDTAInputStream
getEXTDTAStream
(CallableStatement cs, int column, int drdaType) Create a new EXTDTAInputStream from a CallableStatement.static EXTDTAInputStream
getEXTDTAStream
(ResultSet rs, int column, int drdaType) Create a new EXTDTAInputStream.int
hashCode()
void
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.protected boolean
boolean
isNull()
Is the value null?private long
length()
void
mark
(int arg0) boolean
int
read()
RequiresinitInputStream()
be called before we can read from the streamint
read
(byte[] arg0) int
read
(byte[] arg0, int arg1, int arg2) void
reset()
long
skip
(long arg0) Methods inherited from class java.io.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:
read
in classInputStream
- Throws:
IOException
- See Also:
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
- See Also:
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
- See Also:
-
equals
-
hashCode
public int hashCode() -
mark
public void mark(int arg0) - Overrides:
mark
in classInputStream
- See Also:
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
- See Also:
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
- See Also:
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
- See Also:
-
reset
- Overrides:
reset
in classInputStream
- Throws:
IOException
- See Also:
-
skip
- Overrides:
skip
in 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
-