Most visited

Recently visited

Added in API level 1

SQLOutput

public interface SQLOutput

java.sql.SQLOutput


用于将用户定义类型的属性写回数据库的输出流。 此接口仅用于自定义映射,由驱动程序使用,并且其方法不会由程序员直接调用。

当实现接口SQLData的类的对象作为参数传递给SQL语句时,JDBC驱动程序调用方法SQLData.getSQLType来确定传递给数据库的SQL数据的类型。 然后驱动程序创建一个SQLOutput的实例并将其传递给方法SQLData.writeSQL 该方法writeSQL依次调用适当SQLOutput 作家方法writeBooleanwriteCharacterStream ,等等),以写入从数据SQLData对象到SQLOutput输出流作为SQL用户定义类型的表示。

Summary

Public methods

abstract void writeArray(Array x)

将SQL ARRAY值写入流。

abstract void writeAsciiStream(InputStream x)

将下一个属性作为ASCII字符流写入流中。

abstract void writeBigDecimal(BigDecimal x)

将下一个属性作为java.math.BigDecimal对象写入流中。

abstract void writeBinaryStream(InputStream x)

将下一个属性作为未解释字节流写入流中。

abstract void writeBlob(Blob x)

将SQL BLOB值写入流。

abstract void writeBoolean(boolean x)

将下一个属性作为Java布尔值写入流中。

abstract void writeByte(byte x)

将下一个属性作为Java字节写入流中。

abstract void writeBytes(byte[] x)

将下一个属性作为字节数组写入流中。

abstract void writeCharacterStream(Reader x)

将下一个属性作为Unicode字符流写入流中。

abstract void writeClob(Clob x)

将SQL CLOB值写入流。

abstract void writeDate(Date x)

将下一个属性作为java.sql.Date对象写入流中。

abstract void writeDouble(double x)

将下一个属性作为Java double写入流中。

abstract void writeFloat(float x)

将下一个属性作为Java float写入流中。

abstract void writeInt(int x)

将下一个属性作为Java int写入流中。

abstract void writeLong(long x)

将下一个属性作为Java long写入流中。

abstract void writeNClob(NClob x)

将SQL NCLOB值写入流。

abstract void writeNString(String x)

以Java编程语言中的 String将下一个属性写入流中。

abstract void writeObject(SQLData x)

将包含在给定 SQLData对象中的数据写入流中。

abstract void writeRef(Ref x)

将SQL REF值写入流。

abstract void writeRowId(RowId x)

将SQL ROWID值写入流。

abstract void writeSQLXML(SQLXML x)

将SQL XML值写入流。

abstract void writeShort(short x)

将下一个属性作为Java短文写入流中。

abstract void writeString(String x)

以Java编程语言中的 String将下一个属性写入流中。

abstract void writeStruct(Struct x)

将SQL结构化类型值写入流中。

abstract void writeTime(Time x)

将下一个属性作为java.sql.Time对象写入流中。

abstract void writeTimestamp(Timestamp x)

将下一个属性作为java.sql.Timestamp对象写入流中。

abstract void writeURL(URL x)

将SQL DATALINK值写入流。

Public methods

writeArray

Added in API level 1
void writeArray (Array x)

将SQL ARRAY值写入流。

Parameters
x Array: an Array object representing data of an SQL ARRAY type
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeAsciiStream

Added in API level 1
void writeAsciiStream (InputStream x)

将下一个属性作为ASCII字符流写入流中。

Parameters
x InputStream: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeBigDecimal

Added in API level 1
void writeBigDecimal (BigDecimal x)

将下一个属性作为java.math.BigDecimal对象写入流中。 使用Java编程语言将下一个属性写入流中作为String

Parameters
x BigDecimal: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeBinaryStream

Added in API level 1
void writeBinaryStream (InputStream x)

将下一个属性作为未解释字节流写入流中。

Parameters
x InputStream: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeBlob

Added in API level 1
void writeBlob (Blob x)

将SQL BLOB值写入流。

Parameters
x Blob: a Blob object representing data of an SQL BLOB value
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeBoolean

Added in API level 1
void writeBoolean (boolean x)

将下一个属性作为Java布尔值写入流中。 以Java编程语言中的String将下一个属性写入流中。

Parameters
x boolean: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeByte

Added in API level 1
void writeByte (byte x)

将下一个属性作为Java字节写入流中。 以Java编程语言中的String将下一个属性写入流中。

Parameters
x byte: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeBytes

Added in API level 1
void writeBytes (byte[] x)

将下一个属性作为字节数组写入流中。 以Java编程语言中的String将下一个属性写入流中。

Parameters
x byte: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeCharacterStream

Added in API level 1
void writeCharacterStream (Reader x)

将下一个属性作为Unicode字符流写入流中。

Parameters
x Reader: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeClob

Added in API level 1
void writeClob (Clob x)

将SQL CLOB值写入流。

Parameters
x Clob: a Clob object representing data of an SQL CLOB value
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeDate

Added in API level 1
void writeDate (Date x)

将下一个属性作为java.sql.Date对象写入流中。 将下一个属性作为Java编程语言中的java.sql.Date对象写入流中。

Parameters
x Date: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeDouble

Added in API level 1
void writeDouble (double x)

将下一个属性作为Java double写入流中。 以Java编程语言中的String将下一个属性写入流中。

Parameters
x double: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeFloat

Added in API level 1
void writeFloat (float x)

将下一个属性作为Java float写入流中。 以Java编程语言中的String将下一个属性写入流中。

Parameters
x float: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeInt

Added in API level 1
void writeInt (int x)

将下一个属性作为Java int写入流中。 以Java编程语言中的String将下一个属性写入流中。

Parameters
x int: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeLong

Added in API level 1
void writeLong (long x)

将下一个属性作为Java long写入流中。 使用Java编程语言将下一个属性写为String

Parameters
x long: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeNClob

Added in API level 9
void writeNClob (NClob x)

将SQL NCLOB值写入流。

Parameters
x NClob: a NClob object representing data of an SQL NCLOB value
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeNString

Added in API level 9
void writeNString (String x)

使用Java编程语言将下一个属性写为String 驱动程序将其发送到流时,将其转换为SQL NCHARNVARCHARLONGNVARCHAR值(取决于驱动程序对NVARCHAR值的限制的参数大小)。

Parameters
x String: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeObject

Added in API level 1
void writeObject (SQLData x)

将给定的SQLData对象中包含的数据写入流。 SQLData对象为null ,此方法将SQL NULL写入流。 否则,它会调用给定对象的SQLData.writeSQL方法,将对象的属性写入流中。 方法SQLData.writeSQ的实现调用适当的SQLOutput方法来按顺序编写每个对象的属性。 这些属性必须从SQLInput输入流中读取,并按照它们在用户定义类型的SQL定义中列出的顺序写入SQLOutput输出流。

Parameters
x SQLData: the object representing data of an SQL structured or distinct type
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeRef

Added in API level 1
void writeRef (Ref x)

将SQL REF值写入流。

Parameters
x Ref: a Ref object representing data of an SQL REF value
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeRowId

Added in API level 9
void writeRowId (RowId x)

将SQL ROWID值写入流。

Parameters
x RowId: a RowId object representing data of an SQL ROWID value
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeSQLXML

Added in API level 9
void writeSQLXML (SQLXML x)

将SQL XML值写入流。

Parameters
x SQLXML: a SQLXML object representing data of an SQL XML value
Throws
SQLException if a database access error occurs, the java.xml.transform.Result, Writer or OutputStream has not been closed for the SQLXML object or if there is an error processing the XML value. The getCause method of the exception may provide a more detailed exception, for example, if the stream does not contain valid XML.
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeShort

Added in API level 1
void writeShort (short x)

将下一个属性作为Java短文写入流中。 使用Java编程语言将下一个属性写入流中作为String

Parameters
x short: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeString

Added in API level 1
void writeString (String x)

以Java编程语言中的 String将下一个属性写入流中。

Parameters
x String: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeStruct

Added in API level 1
void writeStruct (Struct x)

将SQL结构化类型值写入流中。

Parameters
x Struct: a Struct object representing data of an SQL structured type
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeTime

Added in API level 1
void writeTime (Time x)

将下一个属性作为java.sql.Time对象写入流中。 将下一个属性作为Java编程语言中的java.sql.Date对象写入流中。

Parameters
x Time: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeTimestamp

Added in API level 1
void writeTimestamp (Timestamp x)

将下一个属性作为java.sql.Timestamp对象写入流中。 将下一个属性作为Java编程语言中的java.sql.Date对象写入流中。

Parameters
x Timestamp: the value to pass to the database
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

writeURL

Added in API level 1
void writeURL (URL x)

将SQL DATALINK值写入流。

Parameters
x URL: a java.net.URL object representing the data of SQL DATALINK type
Throws
SQLException if a database access error occurs
SQLFeatureNotSupportedException if the JDBC driver does not support this method

Hooray!