|
JavaTM 2 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 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。