SQLInputImpl object is an input stream that contains a
stream of values that are the attributes of a UDT.
This class is used by the driver behind the scenes when the method
getObject is called on an SQL structured or distinct type
that has a custom mapping; a programmer never invokes
SQLInputImpl methods directly. They are provided here as a
convenience for those who write RowSet implementations.
The SQLInputImpl class provides a set of
reader methods analogous to the ResultSet getter
methods. These methods make it possible to read the values in an
SQLInputImpl object.
The method wasNull is used to determine whether the
the last value read was SQL NULL.
When the method getObject is called with an
object of a class implementing the interface SQLData,
the JDBC driver calls the method SQLData.getSQLType
to determine the SQL type of the UDT being custom mapped. The driver
creates an instance of SQLInputImpl, populating it with the
attributes of the UDT. The driver then passes the input
stream to the method SQLData.readSQL, which in turn
calls the SQLInputImpl reader methods
to read the attributes from the input stream.
java.sql.SQLData
| Modifier and Type | Field and Description |
|---|---|
| private Object[] | attrib
The array of attributes to be read from this stream. |
| private int | idx
The current index into the array of SQL structured type attributes
that will be read from this |
| private boolean | lastValueWasNull
|
| private Map | map
The type map to use when the method |
| Access | Constructor and Description |
|---|---|
| public | SQLInputImpl(Object[]
an array of attributes, Map<String, Class<?>> Object instances in which
each element is an attribute of a UDT. The order of the
attributes in the array is the same order in which
the attributes were defined in the UDT definition.a map)java.util.Map object containing zero or more
entries, with each entry consisting of 1) a String
giving the fully
qualified name of the UDT and 2) the Class object
for the SQLData implementation that defines how
the UDT is to be mappedCreates an |
| Modifier and Type | Method and Description |
|---|---|
| private Object | Returns: the next value in the input stream as anObject in the Java programming languageRetrieves the next attribute in this |
| public Array | Returns: anArray object representing the SQL
ARRAY value at the head of the stream; *
if the value is SQL NULL, return
nullImplements java. Reads an SQL |
| public InputStream | Returns: the attribute; if the value isSQL NULL,
return nullImplements java. Returns the next attribute in this |
| public BigDecimal | Returns: the next attribute in thisSQLInputImpl object;
if the value is SQL NULL, return nullImplements java. Retrieves the next attribute in this |
| public InputStream | Returns: the attribute; if the value isSQL NULL, return
nullImplements java. Returns the next attribute in this |
| public Blob | Returns: aBlob object representing the SQL
BLOB value at the head of this stream;
if the value is SQL NULL, return
nullImplements java. Retrieves the |
| public boolean | Returns: the next attribute in thisSQLInputImpl object;
if the value is SQL NULL, return nullImplements java. Retrieves the next attribute in this |
| public byte | Returns: the next attribute in thisSQLInputImpl object;
if the value is SQL NULL, return nullImplements java. Retrieves the next attribute in this |
| public byte[] | Returns: the next attribute in thisSQLInputImpl object;
if the value is SQL NULL, return nullImplements java. Retrieves the next attribute in this |
| public Reader | Returns: the attribute; if the value isSQL NULL, return nullImplements java. Retrieves the next attribute in this |
| public Clob | Returns: aClob object representing the SQL
CLOB value at the head of the stream;
if the value is SQL NULL, return
nullImplements java. Retrieves the |
| public Date | Returns: the next attribute in thisSQLInputImpl object;
if the value is SQL NULL, return nullImplements java. Retrieves the next attribute in this |
| public double | Returns: the next attribute in thisSQLInputImpl object;
if the value is SQL NULL, return nullImplements java. Retrieves the next attribute in this |
| public float | Returns: the next attribute in thisSQLInputImpl object;
if the value is SQL NULL, return nullImplements java. Retrieves the next attribute in this |
| public int | Returns: the next attribute in thisSQLInputImpl object;
if the value is SQL NULL, return nullImplements java. Retrieves the next attribute in this |
| public long | Returns: the next attribute in thisSQLInputImpl object;
if the value is SQL NULL, return nullImplements java. Retrieves the next attribute in this |
| public NClob | Returns: aNClob object representing data of the SQL NCLOB value
at the head of the stream; null if the value read is
SQL NULLImplements java. Reads an SQL |
| public String | Returns: the attribute; if the value is SQLNULL, returns nullImplements java. Reads the next attribute in the stream and returns it as a |
| public Object | Returns: the value at the head of the stream as anObject
in the Java programming language; null if
the value is SQL NULLImplements java. Retrieves the value at the head of this |
| public Ref | Returns: aRef object representing the SQL
REF value at the head of the stream; if the value
is SQL NULL return nullImplements java. Retrieves the value at the head of this |
| public RowId | Returns: aRowId object representing data of the SQL ROWID value
at the head of the stream; null if the value read is
SQL NULLImplements java. Reads an SQL |
| public short | Returns: the next attribute in thisSQLInputImpl object;
if the value is SQL NULL, return nullImplements java. Retrieves the next attribute in this |
| public SQLXML | Returns: aSQLXML object representing data of the SQL XML value
at the head of the stream; null if the value read is
SQL NULLImplements java. Reads an SQL |
| public String | Returns: the next attribute in thisSQLInputImpl object;
if the value is SQL NULL, return nullImplements java. Retrieves the next attribute in this |
| public Time | Returns: the attribute; if the value isSQL NULL, return
nullImplements java. Retrieves the next attribute in this |
| public Timestamp | Returns: the attribute; if the value isSQL NULL, return
nullImplements java. Retrieves the next attribute in this |
| public URL | Returns: anURL object representing the SQL
DATALINK value at the head of the stream; *
if the value is SQL NULL, return
nullImplements java. Reads an SQL |
| public boolean | Returns: true if the SQL value read most recently was
null; otherwise, false; by default it
will return falseImplements java. Ascertains whether the last value read from this
|
| attrib | back to summary |
|---|---|
| private Object[] attrib The array of attributes to be read from this stream. The order of the attributes is the same as the order in which they were listed in the SQL definition of the UDT. | |
| idx | back to summary |
|---|---|
| private int idx The current index into the array of SQL structured type attributes
that will be read from this | |
| lastValueWasNull | back to summary |
|---|---|
| private boolean lastValueWasNull
| |
| map | back to summary |
|---|---|
| private Map<String, Class<?>> map The type map to use when the method | |
| SQLInputImpl | back to summary |
|---|---|
| public SQLInputImpl(Object[] attributes, Map<String, Class<?>> map) throws SQLException Creates an
| |
| getNextAttribute | back to summary |
|---|---|
| private Object getNextAttribute() throws SQLException Retrieves the next attribute in this
| |
| readArray | back to summary |
|---|---|
| public Array readArray() throws SQLException Implements java. Reads an SQL
This method does not perform type-safe checking to determine if the
returned type is the expected type as this responsibility is delegated
to the UDT mapping as implemented by a
| |
| readAsciiStream | back to summary |
|---|---|
| public InputStream readAsciiStream() throws SQLException Implements java. Returns the next attribute in this
This method does not perform type-safe checking to determine if the
returned type is the expected type as this responsibility is delegated
to the UDT mapping as implemented by a
| |
| readBigDecimal | back to summary |
|---|---|
| public BigDecimal readBigDecimal() throws SQLException Implements java. Retrieves the next attribute in this
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a
| |
| readBinaryStream | back to summary |
|---|---|
| public InputStream readBinaryStream() throws SQLException Implements java. Returns the next attribute in this
This method does not perform type-safe checking to determine if the
returned type is the expected type as this responsibility is delegated
to the UDT mapping as implemented by a
| |
| readBlob | back to summary |
|---|---|
| public Blob readBlob() throws SQLException Implements java. Retrieves the
This method does not perform type-safe checking to determine if the
returned type is the expected type as this responsibility is delegated
to the UDT mapping as implemented by a
| |
| readBoolean | back to summary |
|---|---|
| public boolean readBoolean() throws SQLException Implements java. Retrieves the next attribute in this
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a
| |
| readByte | back to summary |
|---|---|
| public byte readByte() throws SQLException Implements java. Retrieves the next attribute in this
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a
| |
| readBytes | back to summary |
|---|---|
| public byte[] readBytes() throws SQLException Implements java. Retrieves the next attribute in this
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a
| |
| readCharacterStream | back to summary |
|---|---|
| public Reader readCharacterStream() throws SQLException Implements java. Retrieves the next attribute in this
This method does not perform type-safe checking to determine if the
returned type is the expected type as this responsibility is delegated
to the UDT mapping as implemented by a
| |
| readClob | back to summary |
|---|---|
| public Clob readClob() throws SQLException Implements java. Retrieves the
This method does not perform type-safe checking to determine if the
returned type is the expected type as this responsibility is delegated
to the UDT mapping as implemented by a
| |
| readDate | back to summary |
|---|---|
| public Date readDate() throws SQLException Implements java. Retrieves the next attribute in this
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a
| |
| readDouble | back to summary |
|---|---|
| public double readDouble() throws SQLException Implements java. Retrieves the next attribute in this
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a
| |
| readFloat | back to summary |
|---|---|
| public float readFloat() throws SQLException Implements java. Retrieves the next attribute in this
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a
| |
| readInt | back to summary |
|---|---|
| public int readInt() throws SQLException Implements java. Retrieves the next attribute in this
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a
| |
| readLong | back to summary |
|---|---|
| public long readLong() throws SQLException Implements java. Retrieves the next attribute in this
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a
| |
| readNClob | back to summary |
|---|---|
| public NClob readNClob() throws SQLException Implements java. Reads an SQL
| |
| readNString | back to summary |
|---|---|
| public String readNString() throws SQLException Implements java. Reads the next attribute in the stream and returns it as a
| |
| readObject | back to summary |
|---|---|
| public Object readObject() throws SQLException Implements java. Retrieves the value at the head of this The JDBC technology-enabled driver registers a type map with the stream before passing the stream to the application.
When the datum at the head of the stream is an SQL
| |
| readRef | back to summary |
|---|---|
| public Ref readRef() throws SQLException Implements java. Retrieves the value at the head of this
| |
| readRowId | back to summary |
|---|---|
| public RowId readRowId() throws SQLException Implements java. Reads an SQL
| |
| readShort | back to summary |
|---|---|
| public short readShort() throws SQLException Implements java. Retrieves the next attribute in this
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a
| |
| readSQLXML | back to summary |
|---|---|
| public SQLXML readSQLXML() throws SQLException Implements java. Reads an SQL
| |
| readString | back to summary |
|---|---|
| public String readString() throws SQLException Implements java. Retrieves the next attribute in this
This method does not perform type-safe checking to determine if the
returned type is the expected type; this responsibility is delegated
to the UDT mapping as defined by a
| |
| readTime | back to summary |
|---|---|
| public Time readTime() throws SQLException Implements java. Retrieves the next attribute in this
This method does not perform type-safe checking to determine if the
returned type is the expected type as this responsibility is delegated
to the UDT mapping as implemented by a
| |
| readTimestamp | back to summary |
|---|---|
| public Timestamp readTimestamp() throws SQLException Implements java. Retrieves the next attribute in this
| |
| readURL | back to summary |
|---|---|
| public URL readURL() throws SQLException Implements java. Reads an SQL
This method does not perform type-safe checking to determine if the
returned type is the expected type as this responsibility is delegated
to the UDT mapping as implemented by a
| |
| wasNull | back to summary |
|---|---|
| public boolean wasNull() throws SQLException Implements java. Ascertains whether the last value read from this
| |