|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.sql.rowset.serial.SQLOutputImpl
public class SQLOutputImpl
用于将自定义映射的用户定义类型 (UDT) 的属性写回数据库的输出流。驱动程序在内部使用此接口,应用程序员决不能直接调用其方法。
当应用程序调用 PreparedStatement.setObject 方法时,驱动程序将检查要写入的值是否具有自定义映射关系的 UDT。如果是,则在类型映射表中将存在一个条目,该条目包含 Class 对象,用于为此 UDT 实现 SQLData 的类。如果要写入的值是 SQLData 的实例,则驱动程序将创建 SQLOutputImpl 的实例并将其传递给 SQLData.writeSQL 方法。writeSQL 方法依次调用适当的 SQLOutputImpl.writeXXX 方法,从 SQLData 对象以 SQL 用户定义类型的表示形式将数据写入 SQLOutputImpl 输出流。
| 构造方法摘要 | |
|---|---|
SQLOutputImpl(Vector<?> attributes,
Map<String,?> map)
创建一个新的 SQLOutputImpl 对象,并使用给定的属性向量和类型映射表进行初始化。 |
|
| 方法摘要 | |
|---|---|
void |
writeArray(Array x)
将 Java 编程语言中的 Array 对象写入此 SQLOutputImpl 对象。 |
void |
writeAsciiStream(InputStream x)
将 ASCII 字符流写入此 SQLOutputImpl 对象。 |
void |
writeBigDecimal(BigDecimal x)
将 Java 编程语言中的 java.math.BigDecimal 对象写入此 SQLOutputImpl 对象。 |
void |
writeBinaryStream(InputStream x)
将未解释字节流写入此 SQLOutputImpl 对象。 |
void |
writeBlob(Blob x)
将 Java 编程语言中的 Blob 对象写入此 SQLOutputImpl 对象。 |
void |
writeBoolean(boolean x)
将 Java 编程语言中的 boolean 写入此 SQLOutputImpl 对象。 |
void |
writeByte(byte x)
将 Java 编程语言中的 byte 写入此 SQLOutputImpl 对象。 |
void |
writeBytes(byte[] x)
将 Java 编程语言中的 byte 数组写入此 SQLOutputImpl 对象。 |
void |
writeCharacterStream(Reader x)
将 Unicode 字符流写入此 SQLOutputImpl 对象。 |
void |
writeClob(Clob x)
将 Java 编程语言中的 Clob 对象写入此 SQLOutputImpl 对象。 |
void |
writeDate(Date x)
将 Java 编程语言中的 java.sql.Date 对象写入此 SQLOutputImpl 对象。 |
void |
writeDouble(double x)
将 Java 编程语言中的 double 写入此 SQLOutputImpl 对象。 |
void |
writeFloat(float x)
将 Java 编程语言中的 float 写入此 SQLOutputImpl 对象。 |
void |
writeInt(int x)
将 Java 编程语言中的 int 写入此 SQLOutputImpl 对象。 |
void |
writeLong(long x)
将 Java 编程语言中的 long 写入此 SQLOutputImpl 对象。 |
void |
writeNClob(NClob x)
将 SQL NCLOB 值写入流中。 |
void |
writeNString(String x)
将下一个属性以 Java 编程语言中 String 的形式写入流中。 |
void |
writeObject(SQLData x)
将包含在给定 SQLData 对象中的数据写入流中。 |
void |
writeRef(Ref x)
将 Java 编程语言中的 Ref 对象写入此 SQLOutputImpl 对象。 |
void |
writeRowId(RowId x)
将 SQL ROWID 值写入流中。 |
void |
writeShort(short x)
将 Java 编程语言中的 short 写入此 SQLOutputImpl 对象。 |
void |
writeSQLXML(SQLXML x)
将 SQL XML 值写入流中。 |
void |
writeString(String x)
将 Java 编程语言中的 String 写入此 SQLOutputImpl 对象。 |
void |
writeStruct(Struct x)
将 Java 编程语言中的 Struct 对象写入此 SQLOutputImpl 对象。 |
void |
writeTime(Time x)
将 Java 编程语言中的 java.sql.Time 对象写入此 SQLOutputImpl 对象。 |
void |
writeTimestamp(Timestamp x)
将 Java 编程语言中的 java.sql.Timestamp 对象写入此 SQLOutputImpl 对象。 |
void |
writeURL(URL url)
将 Java 编程语言中的 java.sql.Type.DATALINK 对象写入此 SQLOutputImpl 对象。 |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public SQLOutputImpl(Vector<?> attributes,
Map<String,?> map)
throws SQLException
SQLOutputImpl 对象,并使用给定的属性向量和类型映射表进行初始化。驱动程序将使用类型映射表来确定要调用的 SQLData.writeSQL 方法。然后,此方法将调用适当的 SQLOutputImpl 写入方法,以便能够将属性写入新输出流。
attributes - Vector 对象,该对象包含要映射为 Java 编程语言中一个或多个对象的 UDT 属性map - 包含零个或多个条目的 java.util.Map 对象,其中每个条目包含:1) 给出 UDT 完全限定名的 String 2) 用于定义 UDT 映射方式的 SQLData 实现的 Class 对象
SQLException - 如果 attributes 或 map 的值为 null| 方法详细信息 |
|---|
public void writeString(String x)
throws SQLException
String 写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为 SQL CHAR、VARCHAR 或 LONGVARCHAR。
SQLOutput 中的 writeStringx - 要传递到数据库的值
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeBoolean(boolean x)
throws SQLException
boolean 写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为 SQL BIT。
SQLOutput 中的 writeBooleanx - 要传递到数据库的值
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeByte(byte x)
throws SQLException
byte 写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为 SQL BIT。
SQLOutput 中的 writeBytex - 要传递到数据库的值
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeShort(short x)
throws SQLException
short 写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为 SQL SMALLINT。
SQLOutput 中的 writeShortx - 要传递到数据库的值
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeInt(int x)
throws SQLException
int 写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为 SQL INTEGER。
SQLOutput 中的 writeIntx - 要传递到数据库的值
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeLong(long x)
throws SQLException
long 写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为 SQL BIGINT。
SQLOutput 中的 writeLongx - 要传递到数据库的值
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeFloat(float x)
throws SQLException
float 写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为 SQL REAL。
SQLOutput 中的 writeFloatx - 要传递到数据库的值
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeDouble(double x)
throws SQLException
double 写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为 SQL DOUBLE。
SQLOutput 中的 writeDoublex - 要传递到数据库的值
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeBigDecimal(BigDecimal x)
throws SQLException
java.math.BigDecimal 对象写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为 SQL NUMERIC。
SQLOutput 中的 writeBigDecimalx - 要传递到数据库的值
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeBytes(byte[] x)
throws SQLException
byte 数组写入此 SQLOutputImpl 对象。在此值返回数据库之前,驱动程序首先将它转换为 SQL VARBINARY 或 LONGVARBINARY。
SQLOutput 中的 writeBytesx - 要传递到数据库的值
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeDate(Date x)
throws SQLException
java.sql.Date 对象写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为 SQL DATE。
SQLOutput 中的 writeDatex - 要传递到数据库的值
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeTime(Time x)
throws SQLException
java.sql.Time 对象写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为 SQL TIME。
SQLOutput 中的 writeTimex - 要传递到数据库的值
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeTimestamp(Timestamp x)
throws SQLException
java.sql.Timestamp 对象写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为 SQL TIMESTAMP。
SQLOutput 中的 writeTimestampx - 要传递到数据库的值
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeCharacterStream(Reader x)
throws SQLException
SQLOutputImpl 对象。驱动程序将执行从 Unicode 到数据库 CHAR 格式的任何必要转换。
SQLOutput 中的 writeCharacterStreamx - 要传递到数据库的值
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeAsciiStream(InputStream x)
throws SQLException
SQLOutputImpl 对象。驱动程序将执行从 ASCII 到数据库 CHAR 格式的任何必要转换。
SQLOutput 中的 writeAsciiStreamx - 要传递到数据库的值
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeBinaryStream(InputStream x)
throws SQLException
SQLOutputImpl 对象。
SQLOutput 中的 writeBinaryStreamx - 要传递到数据库的值
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeObject(SQLData x)
throws SQLException
SQLData 对象中的数据写入流中。当 SQLData 对象为 null 时,此方法将 SQL NULL 写入流中。否则,它将调用给定对象的 SQLData.writeSQL 方法,该方法将对象的属性写入流中。
SQLData.writeSQ 方法的实现调用适当的 SQLOutputImpl.writeXXX 方法,依次写入对象的每个属性。从 SQLInput 输入流读取属性和将属性写入 SQLOutputImpl 输出流都必须按照在用户定义类型的 SQL 定义中将它们列出的顺序进行。
SQLOutput 中的 writeObjectx - 表示 SQL 结构或 distinct 类型的数据的对象
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeRef(Ref x)
throws SQLException
Ref 对象写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为可序列化的 SerialRef SQL REF 值。
SQLOutput 中的 writeRefx - 表示 SQL REF 值的对象
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeBlob(Blob x)
throws SQLException
Blob 对象写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为可序列化的 SerialBlob SQL BLOB 值。
SQLOutput 中的 writeBlobx - 表示 SQL BLOB 值的对象
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeClob(Clob x)
throws SQLException
Clob 对象写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为可序列化的 SerialClob SQL CLOB 值。
SQLOutput 中的 writeClobx - 表示 SQL CLOB 值的对象
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeStruct(Struct x)
throws SQLException
Struct 对象写入此 SQLOutputImpl 对象。在此值返回到数据库前,驱动程序将它转换成 SQL 结构类型值。
在将 SQL 结构类型被映射为 Java 编程语言中的 Struct 对象(标准映射)时,应该使用此方法。如果将 SQL 结构类型自定义映射为 Java 编程语言中的类,则应该使用 writeObject 方法。
SQLOutput 中的 writeStructx - 表示 SQL 结构类型的属性的对象
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeArray(Array x)
throws SQLException
Array 对象写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为可序列化的 SerialArray SQL ARRAY 值。
SQLOutput 中的 writeArrayx - 表示 SQL ARRAY 值的对象
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeURL(URL url)
throws SQLException
java.sql.Type.DATALINK 对象写入此 SQLOutputImpl 对象。在此值返回到数据库之前,驱动程序首先将它转换为可序列化的 SerialDatalink SQL DATALINK 值。
SQLOutput 中的 writeURLurl - 表示 SQL DATALINK 值的对象
SQLException - 如果尝试将 UDT 的属性值写入数据库的 SQLData 对象正在使用 SQLOutputImpl 对象。
public void writeNString(String x)
throws SQLException
String 的形式写入流中。在将此属性发送到流中时,驱动程序将其转换为 SQL NCHAR、NVARCHAR 或 LONGNVARCHAR 值(具体取决于该参数相对于驱动程序在 NVARCHAR 值上的限制的大小)。
SQLOutput 中的 writeNStringx - 传递给数据库的值
SQLException - 如果发生数据库访问错误
public void writeNClob(NClob x)
throws SQLException
NCLOB 值写入流中。
SQLOutput 中的 writeNClobx - 表示 SQL NCLOB 值的数据的 NClob 对象
SQLException - 如果发生数据库访问错误
public void writeRowId(RowId x)
throws SQLException
ROWID 值写入流中。
SQLOutput 中的 writeRowIdx - 表示 SQL ROWID 值的数据的 RowId 对象
SQLException - 如果发生数据库访问错误
public void writeSQLXML(SQLXML x)
throws SQLException
XML 值写入流中。
SQLOutput 中的 writeSQLXMLx - 表示 SQL XML 值的数据的 SQLXML 对象
SQLException - 如果发生数据库访问错误
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。