Interface SQLInput

An input stream that contains a stream of values representing an
instance of an SQL structured type or an SQL distinct type.
This interface, used only for custom mapping, is used by the driver
behind the scenes, and a programmer never directly invokes
SQLInput methods. The reader methods
(readLong, readBytes, and so on)
provide a way for an implementation of the SQLData
interface to read the values in an SQLInput object.
And as described in SQLData, calls to reader methods must
be made in the order that their corresponding attributes appear in the
SQL definition of the type.
The method wasNull is used to determine whether
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 user-defined type (UDT)
being custom mapped. The driver
creates an instance of SQLInput, 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 SQLInput reader methods
in its implementation for reading the
attributes from the input stream.

readObject

Reads the datum at the head of the stream and returns it as an
Object in the Java programming language. The
actual type of the object returned is determined by the default type
mapping, and any customizations present in this stream's type map.

A type map is registered with the stream by the JDBC driver before the
stream is passed to the application.

When the datum at the head of the stream is an SQL NULL,
the method returns null. If the datum is an SQL structured or distinct
type, it determines the SQL type of the datum at the head of the stream.
If the stream's type map has an entry for that SQL type, the driver
constructs an object of the appropriate class and calls the method
SQLData.readSQL on that object, which reads additional data from the
stream, using the protocol described for that method.

Returns:

the datum at the head of the stream as an Object in the
Java programming language;null if the datum is SQL NULL