SQLInput
interface SQLInput
java.sql.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.
Summary
Public methods | |
---|---|
abstract Array! |
Reads an SQL |
abstract InputStream! |
Reads the next attribute in the stream and returns it as a stream of ASCII characters. |
abstract BigDecimal! |
Reads the next attribute in the stream and returns it as a |
abstract InputStream! |
Reads the next attribute in the stream and returns it as a stream of uninterpreted bytes. |
abstract Blob! |
readBlob() Reads an SQL |
abstract Boolean |
Reads the next attribute in the stream and returns it as a |
abstract Byte |
readByte() Reads the next attribute in the stream and returns it as a |
abstract ByteArray! |
Reads the next attribute in the stream and returns it as an array of bytes in the Java programming language. |
abstract Reader! |
Reads the next attribute in the stream and returns it as a stream of Unicode characters. |
abstract Clob! |
readClob() Reads an SQL |
abstract Date! |
readDate() Reads the next attribute in the stream and returns it as a |
abstract Double |
Reads the next attribute in the stream and returns it as a |
abstract Float |
Reads the next attribute in the stream and returns it as a |
abstract Int |
readInt() Reads the next attribute in the stream and returns it as an |
abstract Long |
readLong() Reads the next attribute in the stream and returns it as a |
abstract NClob! |
Reads an SQL |
abstract String! |
Reads the next attribute in the stream and returns it as a |
abstract Any! |
Reads the datum at the head of the stream and returns it as an |
abstract Ref! |
readRef() Reads an SQL |
abstract RowId! |
Reads an SQL |
abstract SQLXML! |
Reads an SQL |
abstract Short |
Reads the next attribute in the stream and returns it as a |
abstract String! |
Reads the next attribute in the stream and returns it as a |
abstract Time! |
readTime() Reads the next attribute in the stream and returns it as a |
abstract Timestamp! |
Reads the next attribute in the stream and returns it as a |
abstract URL! |
readURL() Reads an SQL |
abstract Boolean |
wasNull() Retrieves whether the last value read was SQL |
Public methods
readArray
abstract fun readArray(): Array!
Reads an SQL ARRAY
value from the stream and returns it as an Array
object in the Java programming language.
Return | |
---|---|
Array! |
an Array object representing data of the SQL ARRAY value at the head of the stream; null if the value read is SQL NULL |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readAsciiStream
abstract fun readAsciiStream(): InputStream!
Reads the next attribute in the stream and returns it as a stream of ASCII characters.
Return | |
---|---|
InputStream! |
the attribute; if the value is SQL NULL , returns null |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readBigDecimal
abstract fun readBigDecimal(): BigDecimal!
Reads the next attribute in the stream and returns it as a java.math.BigDecimal
object in the Java programming language.
Return | |
---|---|
BigDecimal! |
the attribute; if the value is SQL NULL , returns null |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readBinaryStream
abstract fun readBinaryStream(): InputStream!
Reads the next attribute in the stream and returns it as a stream of uninterpreted bytes.
Return | |
---|---|
InputStream! |
the attribute; if the value is SQL NULL , returns null |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readBlob
abstract fun readBlob(): Blob!
Reads an SQL BLOB
value from the stream and returns it as a Blob
object in the Java programming language.
Return | |
---|---|
Blob! |
a Blob object representing data of the SQL BLOB value at the head of the stream; null if the value read is SQL NULL |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readBoolean
abstract fun readBoolean(): Boolean
Reads the next attribute in the stream and returns it as a boolean
in the Java programming language.
Return | |
---|---|
Boolean |
the attribute; if the value is SQL NULL , returns false |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readByte
abstract fun readByte(): Byte
Reads the next attribute in the stream and returns it as a byte
in the Java programming language.
Return | |
---|---|
Byte |
the attribute; if the value is SQL NULL , returns 0 |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readBytes
abstract fun readBytes(): ByteArray!
Reads the next attribute in the stream and returns it as an array of bytes in the Java programming language.
Return | |
---|---|
ByteArray! |
the attribute; if the value is SQL NULL , returns null |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readCharacterStream
abstract fun readCharacterStream(): Reader!
Reads the next attribute in the stream and returns it as a stream of Unicode characters.
Return | |
---|---|
Reader! |
the attribute; if the value is SQL NULL , returns null |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readClob
abstract fun readClob(): Clob!
Reads an SQL CLOB
value from the stream and returns it as a Clob
object in the Java programming language.
Return | |
---|---|
Clob! |
a Clob object representing data of the SQL CLOB value at the head of the stream; null if the value read is SQL NULL |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readDate
abstract fun readDate(): Date!
Reads the next attribute in the stream and returns it as a java.sql.Date
object.
Return | |
---|---|
Date! |
the attribute; if the value is SQL NULL , returns null |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readDouble
abstract fun readDouble(): Double
Reads the next attribute in the stream and returns it as a double
in the Java programming language.
Return | |
---|---|
Double |
the attribute; if the value is SQL NULL , returns 0 |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readFloat
abstract fun readFloat(): Float
Reads the next attribute in the stream and returns it as a float
in the Java programming language.
Return | |
---|---|
Float |
the attribute; if the value is SQL NULL , returns 0 |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readInt
abstract fun readInt(): Int
Reads the next attribute in the stream and returns it as an int
in the Java programming language.
Return | |
---|---|
Int |
the attribute; if the value is SQL NULL , returns 0 |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readLong
abstract fun readLong(): Long
Reads the next attribute in the stream and returns it as a long
in the Java programming language.
Return | |
---|---|
Long |
the attribute; if the value is SQL NULL , returns 0 |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readNClob
abstract fun readNClob(): NClob!
Reads an SQL NCLOB
value from the stream and returns it as a NClob
object in the Java programming language.
Return | |
---|---|
NClob! |
a NClob object representing data of the SQL NCLOB value at the head of the stream; null if the value read is SQL NULL |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readNString
abstract fun readNString(): String!
Reads the next attribute in the stream and returns it as a String
in the Java programming language. It is intended for use when accessing NCHAR
,NVARCHAR
and LONGNVARCHAR
columns.
Return | |
---|---|
String! |
the attribute; if the value is SQL NULL , returns null |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readObject
abstract fun readObject(): Any!
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.
Return | |
---|---|
Any! |
the datum at the head of the stream as an Object in the Java programming language;null if the datum is SQL NULL |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readRef
abstract fun readRef(): Ref!
Reads an SQL REF
value from the stream and returns it as a Ref
object in the Java programming language.
Return | |
---|---|
Ref! |
a Ref object representing the SQL REF value at the head of the stream; null if the value read is SQL NULL |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readRowId
abstract fun readRowId(): RowId!
Reads an SQL ROWID
value from the stream and returns it as a RowId
object in the Java programming language.
Return | |
---|---|
RowId! |
a RowId object representing data of the SQL ROWID value at the head of the stream; null if the value read is SQL NULL |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readSQLXML
abstract fun readSQLXML(): SQLXML!
Reads an SQL XML
value from the stream and returns it as a SQLXML
object in the Java programming language.
Return | |
---|---|
SQLXML! |
a SQLXML object representing data of the SQL XML value at the head of the stream; null if the value read is SQL NULL |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readShort
abstract fun readShort(): Short
Reads the next attribute in the stream and returns it as a short
in the Java programming language.
Return | |
---|---|
Short |
the attribute; if the value is SQL NULL , returns 0 |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readString
abstract fun readString(): String!
Reads the next attribute in the stream and returns it as a String
in the Java programming language.
Return | |
---|---|
String! |
the attribute; if the value is SQL NULL , returns null |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readTime
abstract fun readTime(): Time!
Reads the next attribute in the stream and returns it as a java.sql.Time
object.
Return | |
---|---|
Time! |
the attribute; if the value is SQL NULL , returns null |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readTimestamp
abstract fun readTimestamp(): Timestamp!
Reads the next attribute in the stream and returns it as a java.sql.Timestamp
object.
Return | |
---|---|
Timestamp! |
the attribute; if the value is SQL NULL , returns null |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
readURL
abstract fun readURL(): URL!
Reads an SQL DATALINK
value from the stream and returns it as a java.net.URL
object in the Java programming language.
Return | |
---|---|
URL! |
a java.net.URL object. |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs, or if a URL is malformed |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
wasNull
abstract fun wasNull(): Boolean
Retrieves whether the last value read was SQL NULL
.
Return | |
---|---|
Boolean |
true if the most recently read SQL value was SQL NULL ; false otherwise |
Exceptions | |
---|---|
java.sql.SQLException |
if a database access error occurs |
java.sql.SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |