PDF (US Ltr) - 1.2Mb
PDF (A4) - 1.2Mb
所有数据库操作都会返回一个结果。返回的结果类型取决于执行的操作。下表概述了不同类型的结果。
表 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)