PDF (美式信紙) - 1.4Mb
PDF (A4) - 1.4Mb
所有資料庫操作都會傳回結果。傳回的結果類型取決於執行的操作。下表概述了不同的結果類型。
表 9.1 結果類別及其提供的資訊
結果類別 |
傳回自 |
提供 |
|---|---|---|
|
|
受操作影響的資料列數、自動產生的文件 ID、最後自動產生的 |
|
|
受操作影響的資料列數、自動產生的文件 ID、最後自動產生的 |
|
|
擷取的資料集 |
|
|
擷取的資料集 |
以下類別圖提供結果類別及其函式的基本概觀。
![In the following functions, square brackets indicate a list of items. This can be any appropriate list type in the target language (an array, a collection, and so on). The BaseResults class contains the following functions: getWarnings(): Warning[] and getWarningsCount(): int, which are diagnostics functions. The Result class contains the following functions: getAffectedItemsCount(): int, getAutoIncrementValue(): int, getGeneratedIds(): String[], which are data change information functions. The DocResult class contains the following functions: fetchAll(): Document[] and fetchOne(): Document, which are document access functions. The RowResult class contains the following functions: fetchAll(): Row[], fetchOne(): Row, getColumns(): Column[], and nextResult(): boolean. The SqlResult class contains the following functions: hasData(): boolean, getAffectedItemsCount(): int, and getAutoIncrementValue(): int.](images/resultset-class-dig.png)