鴻蒙OS SharedResultSet

2022-10-28 10:32 更新

SharedResultSet

public interface SharedResultSet
extends ResultSet

提供訪問(wèn)通過(guò)跨進(jìn)程查詢數(shù)據(jù)庫(kù)獲得的數(shù)據(jù)庫(kù)結(jié)果集的方法。

此類(lèi)擴(kuò)展了 ResultSet 類(lèi)。 該類(lèi)中的一些方法由抽象類(lèi) AbsSharedResultSet 實(shí)現(xiàn)。

Since:

3

嵌套類(lèi)摘要

從接口 ohos.data.resultset.ResultSet 繼承的嵌套類(lèi)/接口
ResultSet.ColumnType

方法總結(jié)

修飾符和類(lèi)型 方法 描述
void fillBlock(int startRowIndex, SharedBlock block) 將 SharedResultSet 的數(shù)據(jù)添加到 SharedBlock。
SharedBlock getBlock() 從 SharedResultSet 中獲取一個(gè)塊。
boolean onGo(int oldRowIndex, int newRowIndex) 當(dāng)結(jié)果集的位置發(fā)生變化時(shí)調(diào)用。
從接口 ohos.data.resultset.ResultSet 繼承的方法
close, getAffectedByUris, getAllColumnNames, getBlob, getColumnCount, getColumnIndexForName, getColumnNameForIndex, getColumnTypeForIndex, getDouble, getExtensions, getFloat, getInt, getLong, getRowCount, getRowIndex, getShort, getString, goTo, goToFirstRow, goToLastRow, goToNextRow, goToPreviousRow, goToRow, isAtFirstRow, isAtLastRow, isClosed, isColumnNull, isEnded, isStarted, registerObserver, setAffectedByUris, setExtensions, unregisterObserver

方法詳情

getBlock

SharedBlock getBlock()

從 SharedResultSet 中獲取一個(gè)塊。

該塊包含 SharedResultSet 的一些數(shù)據(jù)。

返回:

如果找到,則返回該塊; 否則返回 null。

Since:

3

fillBlock

void fillBlock(int startRowIndex, SharedBlock block)

將 SharedResultSet 的數(shù)據(jù)添加到 SharedBlock。

該方法用于將 SharedResultSet 的數(shù)據(jù)(從 startRowIndex 位置開(kāi)始)添加到 SharedBlock 中,直到 SharedResultSet 的所有數(shù)據(jù)都添加到 SharedBlock 或 SharedBlock 空間不足。

參數(shù):

參數(shù)名稱 參數(shù)描述
startRowIndex 表示 SharedResultSet 中的索引。 索引從 0 開(kāi)始,表示第一行。
block 表示要將其數(shù)據(jù)添加到 SharedResultSet 的塊。

Since:

3

onGo

boolean onGo(int oldRowIndex, int newRowIndex)

當(dāng)結(jié)果集的位置發(fā)生變化時(shí)調(diào)用。

當(dāng)結(jié)果集移動(dòng)到新位置時(shí),調(diào)用該方法通知子類(lèi)移動(dòng)結(jié)果。 如果返回 false,則結(jié)果集將移動(dòng)到 beforeFirst 位置。

參數(shù):

參數(shù)名稱 參數(shù)描述
oldRowIndex 表示結(jié)果集的原始位置。
newRowIndex 指示結(jié)果集的新位置。

返回:

如果結(jié)果集移動(dòng)成功,則返回 true; 否則返回 false。

Since:

3

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)