public interface SQLInput
| java.sql.SQLInput |
包含表示SQL结构化类型或SQL不同类型的实例的值流的输入流。 该接口仅用于自定义映射,由驱动程序在幕后使用,程序员从不直接调用SQLInput方法。 读取器的方法( readLong , readBytes ,等等)为的实现提供了一种方法SQLData接口以读取值SQLInput对象。 如SQLData ,必须按照其相应属性出现在该类型的SQL定义中的顺序进行对reader方法的调用。 方法wasNull用于确定读取的最后一个值是否为SQL NULL 。
当该方法getObject调用与实现该接口的类的对象SQLData ,JDBC驱动程序调用该方法SQLData.getSQLType ,以确定用户定义的类型(UDT)的SQL类型而定制映射。 驱动程序创建一个SQLInput的实例,并使用UDT的属性填充该实例。 然后,驱动程序将输入流传SQLData.readSQL方法SQLData.readSQL ,该方法依次在其实现中调用SQLInput阅读器方法以读取输入流中的属性。
公共方法(Public methods) |
|
|---|---|
abstract Array |
readArray() 从流中读取SQL |
abstract InputStream |
readAsciiStream() 读取流中的下一个属性并将其作为ASCII字符流返回。 |
abstract BigDecimal |
readBigDecimal() 读取流中的下一个属性,并将其作为Java编程语言中的 |
abstract InputStream |
readBinaryStream() 读取流中的下一个属性,并将其作为未解释字节流返回。 |
abstract Blob |
readBlob() 从流中读取SQL |
abstract boolean |
readBoolean() 读取流中的下一个属性,并以Java编程语言中的 |
abstract byte |
readByte() 读取流中的下一个属性,并以Java编程语言中的 |
abstract byte[] |
readBytes() 读取流中的下一个属性,并将其作为Java编程语言中的字节数组返回。 |
abstract Reader |
readCharacterStream() 读取流中的下一个属性并将其作为Unicode字符流返回。 |
abstract Clob |
readClob() 从流中读取SQL |
abstract Date |
readDate() 读取流中的下一个属性并将其作为 |
abstract double |
readDouble() 读取流中的下一个属性,并以Java编程语言中的 |
abstract float |
readFloat() 读取流中的下一个属性,并以Java编程语言中的 |
abstract int |
readInt() 读取流中的下一个属性,并以Java编程语言中的 |
abstract long |
readLong() 读取流中的下一个属性,并以Java编程语言中的 |
abstract NClob |
readNClob() 从流中读取SQL |
abstract String |
readNString() 读取流中的下一个属性,并以Java编程语言中的 |
abstract Object |
readObject() 读取流头部的数据,并以Java编程语言中的 |
abstract Ref |
readRef() 从流中读取SQL |
abstract RowId |
readRowId() 从流中读取SQL |
abstract SQLXML |
readSQLXML() 从流中读取SQL |
abstract short |
readShort() 读取流中的下一个属性,并以Java编程语言中的 |
abstract String |
readString() 读取流中的下一个属性,并以Java编程语言中的 |
abstract Time |
readTime() 读取流中的下一个属性并将其作为 |
abstract Timestamp |
readTimestamp() 读取流中的下一个属性并将其作为 |
abstract URL |
readURL() 从流中读取SQL |
abstract boolean |
wasNull() 检索读取的最后一个值是否为SQL |
Array readArray ()
从流中读取SQL ARRAY值,并以Java编程语言中的 Array对象形式返回。
| 返回(Returns) | |
|---|---|
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 |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
InputStream readAsciiStream ()
读取流中的下一个属性并将其作为ASCII字符流返回。
| 返回(Returns) | |
|---|---|
InputStream |
the attribute; if the value is SQL NULL, returns null |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
BigDecimal readBigDecimal ()
读取流中的下一个属性并将其作为Java编程语言中的 java.math.BigDecimal对象返回。
| 返回(Returns) | |
|---|---|
BigDecimal |
the attribute; if the value is SQL NULL, returns null |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
InputStream readBinaryStream ()
读取流中的下一个属性,并将其作为未解释字节流返回。
| 返回(Returns) | |
|---|---|
InputStream |
the attribute; if the value is SQL NULL, returns null |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
Blob readBlob ()
从流中读取SQL BLOB值,并将其作为Java编程语言中的 Blob对象返回。
| 返回(Returns) | |
|---|---|
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 |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
boolean readBoolean ()
读取流中的下一个属性,并以Java编程语言中的 boolean返回。
| 返回(Returns) | |
|---|---|
boolean |
the attribute; if the value is SQL NULL, returns false |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
byte readByte ()
读取流中的下一个属性,并以Java编程语言中的 byte返回。
| 返回(Returns) | |
|---|---|
byte |
the attribute; if the value is SQL NULL, returns 0 |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
byte[] readBytes ()
读取流中的下一个属性,并将其作为Java编程语言中的字节数组返回。
| 返回(Returns) | |
|---|---|
byte[] |
the attribute; if the value is SQL NULL, returns null |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
Reader readCharacterStream ()
读取流中的下一个属性并将其作为Unicode字符流返回。
| 返回(Returns) | |
|---|---|
Reader |
the attribute; if the value is SQL NULL, returns null |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
Clob readClob ()
从流中读取SQL CLOB值,并将其作为Java编程语言中的 Clob对象返回。
| 返回(Returns) | |
|---|---|
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 |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
Date readDate ()
读取流中的下一个属性并将其作为 java.sql.Date对象返回。
| 返回(Returns) | |
|---|---|
Date |
the attribute; if the value is SQL NULL, returns null |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
double readDouble ()
读取流中的下一个属性,并以Java编程语言中的 double返回。
| 返回(Returns) | |
|---|---|
double |
the attribute; if the value is SQL NULL, returns 0 |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
float readFloat ()
读取流中的下一个属性,并以Java编程语言中的 float返回。
| 返回(Returns) | |
|---|---|
float |
the attribute; if the value is SQL NULL, returns 0 |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
int readInt ()
读取流中的下一个属性,并以Java编程语言中的 int返回。
| 返回(Returns) | |
|---|---|
int |
the attribute; if the value is SQL NULL, returns 0 |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
long readLong ()
读取流中的下一个属性,并以Java编程语言中的 long返回。
| 返回(Returns) | |
|---|---|
long |
the attribute; if the value is SQL NULL, returns 0 |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
NClob readNClob ()
从流中读取SQL NCLOB值,并将其作为Java编程语言中的 NClob对象返回。
| 返回(Returns) | |
|---|---|
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 |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
String readNString ()
读取流中的下一个属性并将其作为Java编程语言中的String返回。 访问时,它适用于使用NCHAR , NVARCHAR和LONGNVARCHAR列。
| 返回(Returns) | |
|---|---|
String |
the attribute; if the value is SQL NULL, returns null |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
Object readObject ()
读取流头部的数据并将其作为Java编程语言中的Object返回。 返回的对象的实际类型由缺省类型映射确定,并且此流的类型映射中存在任何自定义。
在流传递给应用程序之前,JDBC驱动程序向流注册类型映射。
当数据流头部的数据是SQL NULL ,该方法返回null 。 如果数据是SQL结构或不同类型的数据,它将确定数据流头部的数据的SQL类型。 如果流的类型映射具有该SQL类型的条目,那么驱动程序会构造适当类的对象,并使用该方法描述的协议在该对象上调用方法SQLData.readSQL ,该方法从流中读取其他数据。
| 返回(Returns) | |
|---|---|
Object |
the datum at the head of the stream as an Object in the Java programming language;null if the datum is SQL NULL |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
Ref readRef ()
从流中读取SQL REF值,并将其作为Java编程语言中的 Ref对象返回。
| 返回(Returns) | |
|---|---|
Ref |
a Ref object representing the SQL REF value at the head of the stream; null if the value read is SQL NULL |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
RowId readRowId ()
从流中读取SQL ROWID值,并将其作为Java编程语言中的 RowId对象返回。
| 返回(Returns) | |
|---|---|
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 |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
SQLXML readSQLXML ()
从流中读取SQL XML值,并将其作为Java编程语言中的 SQLXML对象返回。
| 返回(Returns) | |
|---|---|
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 |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
short readShort ()
读取流中的下一个属性,并以Java编程语言中的 short返回。
| 返回(Returns) | |
|---|---|
short |
the attribute; if the value is SQL NULL, returns 0 |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
String readString ()
读取流中的下一个属性,并以Java编程语言中的 String返回。
| 返回(Returns) | |
|---|---|
String |
the attribute; if the value is SQL NULL, returns null |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
Time readTime ()
读取流中的下一个属性并将其作为 java.sql.Time对象返回。
| 返回(Returns) | |
|---|---|
Time |
the attribute; if the value is SQL NULL, returns null |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
Timestamp readTimestamp ()
读取流中的下一个属性并将其作为 java.sql.Timestamp对象返回。
| 返回(Returns) | |
|---|---|
Timestamp |
the attribute; if the value is SQL NULL, returns null |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
URL readURL ()
从流中读取SQL DATALINK值,并将其作为Java编程语言中的 java.net.URL对象返回。
| 返回(Returns) | |
|---|---|
URL |
a java.net.URL object. |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs, or if a URL is malformed |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |
boolean wasNull ()
检索读取的最后一个值是否为SQL NULL 。
| 返回(Returns) | |
|---|---|
boolean |
true if the most recently read SQL value was SQL NULL; false otherwise |
| 抛出异常(Throws) | |
|---|---|
SQLException |
if a database access error occurs |
SQLFeatureNotSupportedException |
if the JDBC driver does not support this method |