ResultSetpublic class CombinedResultSet extends AbsResultSet
Different types of result sets can be combined in a CombinedResultSet. When the getAllColumnNames()
or getColumnTypeForIndex(int) method is called, column names or the column type in the original result set
matching the row of the CombinedResultSet is returned.
SystemCapability.Data#DATA_APPDATAMGRResultSet.ColumnTypeDEFAULT_POS, isClosed, pos| 构造器 | 说明 |
|---|---|
CombinedResultSet(ResultSet[] resultSets) |
Instantiate the parameterized constructor of
CombinedResultSet. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
close() |
Closes the result set.
|
String[] |
getAllColumnNames() |
Obtains the names of all columns in a result set.
|
byte[] |
getBlob(int columnIndex) |
Obtains the value of the specified column in the current row as a byte array.
|
ResultSet.ColumnType |
getColumnTypeForIndex(int columnIndex) |
Obtains the data type based on the specified column index.
|
double |
getDouble(int columnIndex) |
Obtains the value of the specified column in the current row as a double.
|
float |
getFloat(int columnIndex) |
Obtains the value of the specified column in the current row as a float.
|
int |
getInt(int columnIndex) |
Obtains the value of the specified column in the current row as an int.
|
long |
getLong(int columnIndex) |
Obtains the value of the specified column in the current row as a long.
|
int |
getRowCount() |
Obtains the number of rows in the result set.
|
short |
getShort(int columnIndex) |
Obtains the value of the specified column in the current row as a short.
|
String |
getString(int columnIndex) |
Obtains the value of the specified column in the current row as a string.
|
boolean |
goToRow(int rowIndex) |
Go to the specified row of the result set.
|
boolean |
isColumnNull(int columnIndex) |
Checks whether the value of the specified column in the current row is null.
|
void |
registerObserver(DataObserver observer) |
Registers an observer that listens for data changes.
|
void |
unregisterObserver(DataObserver observer) |
Deregisters an observer that listens for data changes.
|
finalize, getAffectedByUris, getColumnCount, getColumnIndexForName, getColumnNameForIndex, getExtensions, getRowIndex, goTo, goToFirstRow, goToLastRow, goToNextRow, goToPreviousRow, isAtFirstRow, isAtLastRow, isClosed, isEnded, isStarted, notifyChange, setAffectedByUris, setExtensionspublic CombinedResultSet(ResultSet[] resultSets)
CombinedResultSet.
Initialize the combined result set based on the result set array passed in by the user.
resultSets - The result set array used to initialize the combined result set.public int getRowCount()
ResultSetgetRowCount 在接口中 ResultSetgetRowCount 在类中 AbsResultSetpublic String[] getAllColumnNames()
ResultSetThe column names are returned as a string array, in which the strings are in the same order as the columns in the result set.
getAllColumnNames 在接口中 ResultSetgetAllColumnNames 在类中 AbsResultSetpublic ResultSet.ColumnType getColumnTypeForIndex(int columnIndex)
ResultSetThe return value is of the enumeration type, which can be an integer, float, String, Blob, or null.
columnIndex - Indicates the specified column index.public byte[] getBlob(int columnIndex)
ResultSetThe implementation class determines whether to throw an exception if the value of the specified column in the current row is null or the specified column is not of the Blob type.
getBlob 在接口中 ResultSetgetBlob 在类中 AbsResultSetcolumnIndex - Indicates the specified column index, which starts from 0.public String getString(int columnIndex)
ResultSetThe implementation class determines whether to throw an exception if the value of the specified column in the current row is null or the specified column is not of the string type.
getString 在接口中 ResultSetgetString 在类中 AbsResultSetcolumnIndex - Indicates the specified column index, which starts from 0.public short getShort(int columnIndex)
ResultSet
he implementation class determines whether to throw an exception if the value of the specified column
in the current row is null, the specified column is not of the integer type, or the integer is beyond
the range [Short.MIN_VALUE, Short.MAX_VALUE].
getShort 在接口中 ResultSetgetShort 在类中 AbsResultSetcolumnIndex - Indicates the specified column index, which starts from 0.public int getInt(int columnIndex)
ResultSet
The implementation class determines whether to throw an exception if the value of the specified column
in the current row is null, the specified column is not of the integer type, or the integer is beyond
the range [Integer.MIN_VALUE, Integer.MAX_VALUE].
getInt 在接口中 ResultSetgetInt 在类中 AbsResultSetcolumnIndex - Indicates the specified column index, which starts from 0.public long getLong(int columnIndex)
ResultSetThe implementation class determines whether to throw an exception if the value of the specified column
in the current row is null, the specified column is not of the integer type, or the integer is beyond the
range [Long.MIN_VALUE, Long.MAX_VALUE].
getLong 在接口中 ResultSetgetLong 在类中 AbsResultSetcolumnIndex - Indicates the specified column index, which starts from 0.public float getFloat(int columnIndex)
ResultSetThe implementation class determines whether to throw an exception if the value of the specified column in
the current row is null, the specified column is not of the floating-point type, or the floating-point value
cannot be represented by a float.
getFloat 在接口中 ResultSetgetFloat 在类中 AbsResultSetcolumnIndex - Indicates the specified column index, which starts from 0.public double getDouble(int columnIndex)
ResultSetThe implementation class determines whether to throw an exception if the value of the specified column
in the current row is null, the specified column is not of the floating-point type, or the floating-point
value cannot be represented by a double.
getDouble 在接口中 ResultSetgetDouble 在类中 AbsResultSetcolumnIndex - Indicates the specified column index, which starts from 0.public boolean isColumnNull(int columnIndex)
ResultSetisColumnNull 在接口中 ResultSetisColumnNull 在类中 AbsResultSetcolumnIndex - Indicates the specified column index, which starts from 0.true if the value of the specified column in the current row is null;
returns false otherwise.public void close()
ResultSetCalling this method on the result set will release all of its resources and makes it ineffective.
close 在接口中 ResultSetclose 在类中 AbsResultSetResultSet.isClosed()public boolean goToRow(int rowIndex)
ResultSetgoToRow 在接口中 ResultSetgoToRow 在类中 AbsResultSetrowIndex - Indicates the index of the specified row, which starts from 0.true if the result set is moved successfully; returns false otherwise.public void registerObserver(DataObserver observer)
ResultSetWhen a notification of the change of data with a specified URI is received, this observer will be triggered.
registerObserver 在接口中 ResultSetregisterObserver 在类中 AbsResultSetobserver - Indicates the observer to be registered.ResultSet.setAffectedByUris(java.lang.Object, java.util.List<ohos.utils.net.Uri>),
ResultSet.unregisterObserver(ohos.data.rdb.DataObserver)public void unregisterObserver(DataObserver observer)
ResultSetThis method is used to release the observer before the component to which the observer belongs is destroyed.
unregisterObserver 在接口中 ResultSetunregisterObserver 在类中 AbsResultSetobserver - Indicates the observer to be deregistered.