is new.
java.lang.Objectjavax.sql.rowset.serial.SQLInputImpl
public class SQLInputImpl
An input stream used for custom mapping user-defined types (UDTs). An 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.
| Constructor Summary | |
|---|---|
|
SQLInputImpl
(
Object
[] attributes,
Map
<
String
,
Class
<?>> map) Creates an SQLInputImpl object initialized with the given array of attributes and the given type map. |
|
| Method Summary | |
|---|---|
| Array |
readArray
() Reads an SQL ARRAY value from the stream and returns it as an Array object in the Java programming language. |
| InputStream |
readAsciiStream
() Returns the next attribute in this SQLInputImpl object as a stream of ASCII characters. |
| BigDecimal |
readBigDecimal
() Retrieves the next attribute in this SQLInputImpl object as a java.math.BigDecimal. |
| InputStream |
readBinaryStream
() Returns the next attribute in this SQLInputImpl object as a stream of uninterpreted bytes. |
| Blob |
readBlob
() Retrieves the BLOB value at the head of this SQLInputImpl object as a Blob object in the Java programming language. |
| boolean |
readBoolean
() Retrieves the next attribute in this SQLInputImpl object as a boolean in the Java programming language. |
| byte |
readByte
() Retrieves the next attribute in this SQLInputImpl object as a byte in the Java programming language. |
| byte[] |
readBytes
() Retrieves the next attribute in this SQLInputImpl object as an array of bytes. |
| Reader |
readCharacterStream
() Retrieves the next attribute in this SQLInputImpl object as a stream of Unicode characters. |
| Clob |
readClob
() Retrieves the CLOB value at the head of this SQLInputImpl object as a Clob object in the Java programming language. |
| Date |
readDate
() Retrieves the next attribute in this SQLInputImpl as a java.sql.Date object. |
| double |
readDouble
() Retrieves the next attribute in this SQLInputImpl object as a double in the Java programming language. |
| float |
readFloat
() Retrieves the next attribute in this SQLInputImpl object as a float in the Java programming language. |
| int |
readInt
() Retrieves the next attribute in this SQLInputImpl object as an int in the Java programming language. |
| long |
readLong
() Retrieves the next attribute in this SQLInputImpl object as a long in the Java programming language. |
| NClob |
readNClob
() Reads an SQL NCLOB value from the stream and returns it as a
Clob
|
| String |
readNString
() Reads the next attribute in the stream and returns it as a String in the Java programming language. |
| Object |
readObject
() Retrieves the value at the head of this SQLInputImpl object as an Object in the Java programming language. |
| Ref |
readRef
() Retrieves the value at the head of this SQLInputImpl object as a Ref object in the Java programming language. |
| RowId |
readRowId
() Reads an SQL ROWID value from the stream and returns it as a RowId object in the Java programming language. |
| short |
readShort
() Retrieves the next attribute in this SQLInputImpl object as a short in the Java programming language. |
| SQLXML |
readSQLXML
() Reads an SQL XML value from the stream and returns it as a SQLXML object in the Java programming language. |
| String |
readString
() Retrieves the next attribute in this SQLInputImpl object as a String in the Java programming language. |
| Time |
readTime
() Retrieves the next attribute in this SQLInputImpl object as a java.sql.Time object. |
| Timestamp |
readTimestamp
() Retrieves the next attribute in this SQLInputImpl object as a java.sql.Timestamp object. |
| URL |
readURL
() Reads an SQL DATALINK value from the stream and returns it as an URL object in the Java programming language. |
| boolean |
wasNull
() Ascertains whether the last value read from this SQLInputImpl object was null. |
| Methods inherited from class java.lang. Object |
|---|
| clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
| Constructor Detail |
|---|
public SQLInputImpl(Object[] attributes,
Map<String,Class<?>> map)
throws SQLException
| Method Detail |
|---|
public String readString()
throws SQLException
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 SQLData implementation.
public boolean readBoolean()
throws SQLException
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 SQLData implementation.
public byte readByte()
throws SQLException
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 SQLData implementation.
public short readShort()
throws SQLException
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 SQLData implementation.
public int readInt()
throws SQLException
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 SQLData implementation.
public long readLong()
throws SQLException
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 SQLData implementation.
public float readFloat()
throws SQLException
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 SQLData implementation.
public double readDouble()
throws SQLException
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 SQLData implementation.
public BigDecimal readBigDecimal()
throws SQLException
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 SQLData implementation.
public byte[] readBytes()
throws SQLException
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 SQLData implementation.
public Date readDate()
throws SQLException
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 SQLData implementation.
public Time readTime()
throws SQLException
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 SQLData implementation.
public Timestamp readTimestamp()
throws SQLException
public Reader readCharacterStream()
throws SQLException
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 SQLData implementation.
public InputStream readAsciiStream()
throws SQLException
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 SQLData implementation.
public InputStream readBinaryStream()
throws SQLException
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 SQLData implementation.
public Object readObject()
throws SQLException
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 NULL, this method returns null. If the datum is an SQL structured or distinct type with a custom mapping, this method determines the SQL type of the datum at the head of the stream, constructs an object of the appropriate class, and calls the method SQLData.readSQL on that object. The readSQL method then calls the appropriate SQLInputImpl.readXXX methods to retrieve the attribute values from the stream.
public Ref readRef()
throws SQLException
public Blob readBlob()
throws SQLException
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 SQLData implementation.
public Clob readClob()
throws SQLException
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 SQLData implementation.
public Array readArray()
throws SQLException
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 SQLData implementation.
public boolean wasNull()
throws SQLException
public URL readURL()
throws SQLException
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 SQLData implementation.
public NClob readNClob()
throws SQLException
Clob
public String readNString()
throws SQLException
public SQLXML readSQLXML()
throws SQLException
public RowId readRowId()
throws SQLException