public interface SQLOutput
在实现接口的SQLData
类的一个对象作为参数传递给一个SQL语句,JDBC驱动程序的调用方法SQLData.getSQLType
确定SQL数据传递给数据库的类。司机随后创建SQLOutput
实例并将其传递给方法SQLData.writeSQL
。方法writeSQL
依次调用适当的方法SQLOutput
作家writeBoolean
,writeCharacterStream
,等等)写数据从SQLData
对象的SQLOutput
输出流作为一个SQL表示用户定义的类型。
Modifier and Type | Method and Description |
---|---|
void |
writeArray(Array x)
写一个SQL
ARRAY 价值流。
|
void |
writeAsciiStream(InputStream x)
写下一个属性流作为一个ASCII字符流。
|
void |
writeBigDecimal(BigDecimal x)
写下一个属性的流作为一个java.math.bigdecimal对象。
|
void |
writeBinaryStream(InputStream x)
写下一个属性流未解释的字节流。
|
void |
writeBlob(Blob x)
写一个SQL
BLOB 价值流。
|
void |
writeBoolean(boolean x)
写下一个属性的流作为java布尔。
|
void |
writeByte(byte x)
写下一个属性作为一个java字节流。
|
void |
writeBytes(byte[] x)
将下一个属性写入流作为一个字节数组。
|
void |
writeCharacterStream(Reader x)
写下一个属性流流的Unicode字符。
|
void |
writeClob(Clob x)
写一个SQL
CLOB 价值流。
|
void |
writeDate(Date x)
写下一个属性的流作为一个java.sql.date对象。
|
void |
writeDouble(double x)
写下一个属性的流作为java双。
|
void |
writeFloat(float x)
写下一个属性的流作为java浮。
|
void |
writeInt(int x)
写下一个属性的流作为java int.
|
void |
writeLong(long x)
写下一个属性的流作为java长。
|
void |
writeNClob(NClob x)
写一个SQL
NCLOB 价值流。
|
void |
writeNString(String x)
写下一个属性流的java编程语言中的一
String 。
|
default void |
writeObject(Object x, SQLType targetSqlType)
将包含在给定对象中的数据写入流中。
|
void |
writeObject(SQLData x)
写入流包含在给定的
SQLData 对象的数据。
|
void |
writeRef(Ref x)
写一个SQL
REF 价值流。
|
void |
writeRowId(RowId x)
写一个SQL
ROWID 价值流。
|
void |
writeShort(short x)
写下一个属性的流作为java短。
|
void |
writeSQLXML(SQLXML x)
写一个SQL
XML 价值流。
|
void |
writeString(String x)
写下一个属性流的java编程语言中的一
String 。
|
void |
writeStruct(Struct x)
写一个SQL结构化类型的价值流。
|
void |
writeTime(Time x)
写下一个属性的流作为一个java.sql.time对象。
|
void |
writeTimestamp(Timestamp x)
写下一个属性的流作为一个java.sql.timestamp对象。
|
void |
writeURL(URL x)
写一个SQL
DATALINK 价值流。
|
void writeString(String x) throws SQLException
String
。
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeBoolean(boolean x) throws SQLException
String
。
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeByte(byte x) throws SQLException
String
。
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeShort(short x) throws SQLException
String
。
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeInt(int x) throws SQLException
String
。
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeLong(long x) throws SQLException
String
。
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeFloat(float x) throws SQLException
String
。
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeDouble(double x) throws SQLException
String
。
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeBigDecimal(BigDecimal x) throws SQLException
String
。
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeBytes(byte[] x) throws SQLException
String
。
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeDate(Date x) throws SQLException
java.sql.Date
对象。
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeTime(Time x) throws SQLException
java.sql.Date
对象。
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeTimestamp(Timestamp x) throws SQLException
java.sql.Date
对象。
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeCharacterStream(Reader x) throws SQLException
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeAsciiStream(InputStream x) throws SQLException
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeBinaryStream(InputStream x) throws SQLException
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeObject(SQLData x) throws SQLException
SQLData
对象的数据。当
SQLData
对象是
null
,此方法编写SQL
NULL
到流。否则,它调用
SQLData.writeSQL
方法给定的对象,它将对象的属性的流。该方法的实施
SQLData.writeSQL
调用合适的方法(S)
SQLOutput
作家写作各为对象的属性。属性必须从
SQLInput
输入流读取和写入输出流中的一个
SQLOutput
顺序进行中用户定义类型的SQL定义上市。
x
代表一个SQL结构化或不同类型的数据对象
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeRef(Ref x) throws SQLException
REF
价值流。
x
-代表一个SQL
REF
值数据
Ref
对象
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeBlob(Blob x) throws SQLException
BLOB
价值流。
x
-代表一个SQL
BLOB
值数据
Blob
对象
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeClob(Clob x) throws SQLException
CLOB
价值流。
x
-代表一个SQL
CLOB
值数据
Clob
对象
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeStruct(Struct x) throws SQLException
x
-代表一个结构化的数据对象的类型
Struct
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeArray(Array x) throws SQLException
ARRAY
价值流。
x
-
Array
对象代表一个SQL
ARRAY
型数据
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeURL(URL x) throws SQLException
DATALINK
价值流。
x
-代表SQL数据类型的数据
java.net.URL
对象
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeNString(String x) throws SQLException
String
。司机将一个SQL
NCHAR
或
NVARCHAR
或
LONGNVARCHAR
值(取决于参数的大小相对论
NVARCHAR
值的驾驶限制)当它发送到流。
x
-传递给数据库的价值
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeNClob(NClob x) throws SQLException
NCLOB
价值流。
x
-代表一个SQL
NCLOB
值数据
NClob
对象
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeRowId(RowId x) throws SQLException
ROWID
价值流。
x
-代表一个SQL
ROWID
值数据
RowId
对象
SQLException
-如果一个数据库访问错误发生
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
void writeSQLXML(SQLXML x) throws SQLException
XML
价值流。
x
-代表一个SQL
XML
值数据
SQLXML
对象
SQLException
-如果一个数据库访问错误发生时,该
java.xml.transform.Result
,
Writer
或
OutputStream
尚未关闭的
SQLXML
对象或如果有处理XML值的误差。例外的
getCause
方法可以提供一个更详细的例外,如果流不包含有效的XML。
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持此方法
default void writeObject(Object x, SQLType targetSqlType) throws SQLException
当object
是null
,此方法编写SQL NULL
到流。
如果对象有一个自定义的映射(是实现接口的SQLData
类),JDBC驱动程序应该调用的方法SQLData.writeSQL
写的SQL数据流。如果,另一方面,对象是类的实现Ref
,Blob
,Clob
,NClob
,Struct
,java.net.URL
,或Array
,司机应该通过对数据库的值为相应的SQL类型。
默认实现将SQLFeatureNotSupportedException
x
包含输入参数值的对象
targetSqlType
的SQL类型被发送到数据库。
SQLException
-如果一个数据库访问错误或者指定x的java对象是一个InputStream或Reader对象和尺度参数的值小于零
SQLFeatureNotSupportedException
如果JDBC驱动程序不支持这种数据类型
JDBCType
,
SQLType
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.