|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An input stream that contains a stream of values representing an
instance of an SQL structured or 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 readXXX
methods
provide a way to read the values in an SQLInput
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 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.readXXX
methods
in its implementation for reading the
attributes from the input stream.
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 the stream as a stream of ASCII characters. |
BigDecimal |
readBigDecimal()
Reads the next attribute in the stream as a java.math.BigDecimal
object in the Java programming language. |
InputStream |
readBinaryStream()
Returns the next attribute in the stream as a stream of uninterpreted bytes. |
Blob |
readBlob()
Reads an SQL BLOB value from the stream and returns it as a
Blob object in the Java programming language. |
boolean |
readBoolean()
Reads the next attribute in the stream as a boolean
in the Java programming language. |
byte |
readByte()
Reads the next attribute in the stream as a byte
in the Java programming language. |
byte[] |
readBytes()
Reads the next attribute in the stream as an array of bytes in the Java programming language. |
Reader |
readCharacterStream()
Returns the next attribute in the stream as a stream of Unicode characters. |
Clob |
readClob()
Reads an SQL CLOB value from the stream and returns it as a
Clob object in the Java programming language. |
Date |
readDate()
Reads the next attribute in the stream as a java.sql.Date object. |
double |
readDouble()
Reads the next attribute in the stream as a double
in the Java programming language. |
float |
readFloat()
Reads the next attribute in the stream as a float
in the Java programming language. |
int |
readInt()
Reads the next attribute in the stream as an int
in the Java programming language. |
long |
readLong()
Reads the next attribute in the stream as a long
in the Java programming language. |
Object |
readObject()
Returns the datum at the head of the stream as an Object in the Java programming language. |
Ref |
readRef()
Reads an SQL REF value from the stream and returns it as a
Ref object in the Java programming language. |
short |
readShort()
Reads the next attribute in the stream as a short
in the Java programming language. |
String |
readString()
Reads the next attribute in the stream as a String
in the Java programming language. |
Time |
readTime()
Reads the next attribute in the stream as a java.sql.Time object. |
Timestamp |
readTimestamp()
Reads the next attribute in the stream as a java.sql.Timestamp object. |
boolean |
wasNull()
Determines whether the last value read was SQL NULL . |
Method Detail |
public String readString() throws SQLException
String
in the Java programming language.NULL
, returns null
SQLException
- if a database access error occurspublic boolean readBoolean() throws SQLException
boolean
in the Java programming language.NULL
, returns false
SQLException
- if a database access error occurspublic byte readByte() throws SQLException
byte
in the Java programming language.NULL
, returns 0
SQLException
- if a database access error occurspublic short readShort() throws SQLException
short
in the Java programming language.NULL
, returns 0
SQLException
- if a database access error occurspublic int readInt() throws SQLException
int
in the Java programming language.NULL
, returns 0
SQLException
- if a database access error occurspublic long readLong() throws SQLException
long
in the Java programming language.NULL
, returns 0
SQLException
- if a database access error occurspublic float readFloat() throws SQLException
float
in the Java programming language.NULL
, returns 0
SQLException
- if a database access error occurspublic double readDouble() throws SQLException
double
in the Java programming language.NULL
, returns 0
SQLException
- if a database access error occurspublic BigDecimal readBigDecimal() throws SQLException
java.math.BigDecimal
object in the Java programming language.NULL
, returns null
SQLException
- if a database access error occurspublic byte[] readBytes() throws SQLException
NULL
, returns null
SQLException
- if a database access error occurspublic Date readDate() throws SQLException
java.sql.Date
object.NULL
, returns null
SQLException
- if a database access error occurspublic Time readTime() throws SQLException
java.sql.Time
object.NULL
, returns null
SQLException
- if a database access error occurspublic Timestamp readTimestamp() throws SQLException
java.sql.Timestamp
object.NULL
, returns null
SQLException
- if a database access error occurspublic Reader readCharacterStream() throws SQLException
NULL
, returns null
SQLException
- if a database access error occurspublic InputStream readAsciiStream() throws SQLException
NULL
, returns null
SQLException
- if a database access error occurspublic InputStream readBinaryStream() throws SQLException
NULL
, returns null
SQLException
- if a database access error occurspublic Object readObject() throws SQLException
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.
Object
in the
Java programming language;null
if the datum is SQL NULL
SQLException
- if a database access error occurspublic Ref readRef() throws SQLException
REF
value from the stream and returns it as a
Ref
object in the Java programming language.Ref
object representing the SQL REF
value
at the head of the stream; null
if the value read is
SQL NULL
SQLException
- if a database access error occurspublic Blob readBlob() throws SQLException
BLOB
value from the stream and returns it as a
Blob
object in the Java programming language.Blob
object representing data of the SQL BLOB
value
at the head of the stream; null
if the value read is
SQL NULL
SQLException
- if a database access error occurspublic Clob readClob() throws SQLException
CLOB
value from the stream and returns it as a
Clob
object in the Java programming language.Clob
object representing data of the SQL CLOB
value
at the head of the stream; null
if the value read is
SQL NULL
SQLException
- if a database access error occurspublic Array readArray() throws SQLException
ARRAY
value from the stream and returns it as an
Array
object in the Java programming language.Array
object representing data of the SQL
ARRAY
value at the head of the stream; null
if the value read is SQL NULL
SQLException
- if a database access error occurspublic boolean wasNull() throws SQLException
NULL
.true
if the most recently read SQL value was SQL
NULL
; otherwise, false
SQLException
- if a database access error occurs
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java, Java 2D, and JDBC are trademarks or registered trademarks of Oracle and/or its affiliates, in the US and other countries.
Copyright © 1995, 2010 Oracle and/or its affiliates. All rights reserved.