Package org.h2.result
Class ResultRemote
java.lang.Object
org.h2.result.FetchedResult
org.h2.result.ResultRemote
- All Implemented Interfaces:
AutoCloseable
,ResultInterface
The client side part of a result set that is kept on the server.
In many cases, the complete data is kept on the client side,
but for large results only a subset is in-memory.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ResultColumn[]
private int
private int
private long
private long
private SessionRemote
private final Trace
private Transfer
Fields inherited from class org.h2.result.FetchedResult
afterLast, currentRow, nextRow, rowId
-
Constructor Summary
ConstructorsConstructorDescriptionResultRemote
(SessionRemote session, Transfer transfer, int id, int columnCount, int fetchSize) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the result and delete any temporary filesprivate void
private boolean
fetchRows
(int fetch) getAlias
(int i) Get the column alias name for the column.getColumnName
(int i) Get the column name.getColumnType
(int i) Get the column data type.int
Get the current fetch size for this result set.int
getNullable
(int i) Check if this column is nullable.long
Get the number of rows in this object.getSchemaName
(int i) Get the schema name for the column, if one exists.getTableName
(int i) Get the table name for the column, if one exists.int
Get the number of visible columns.boolean
hasNext()
Check if this result has more rows to fetch.boolean
isClosed()
Check if this result set is closed.boolean
isIdentity
(int i) Check if this is an identity column.boolean
isLazy()
Check if this a lazy execution result.private void
void
reset()
Go to the beginning of the result, that means before the first row.private void
void
setFetchSize
(int fetchSize) Set the fetch size for this result set.toString()
Methods inherited from class org.h2.result.FetchedResult
createShallowCopy, currentRow, getRowId, isAfterLast, needToClose, next
-
Field Details
-
fetchSize
private int fetchSize -
session
-
transfer
-
id
private int id -
columns
-
rowCount
private long rowCount -
rowOffset
private long rowOffset -
result
-
trace
-
-
Constructor Details
-
ResultRemote
public ResultRemote(SessionRemote session, Transfer transfer, int id, int columnCount, int fetchSize) throws IOException - Throws:
IOException
-
-
Method Details
-
isLazy
public boolean isLazy()Description copied from interface:ResultInterface
Check if this a lazy execution result.- Returns:
- true if it is a lazy result
-
getAlias
Description copied from interface:ResultInterface
Get the column alias name for the column.- Parameters:
i
- the column number (starting with 0)- Returns:
- the alias name
-
getSchemaName
Description copied from interface:ResultInterface
Get the schema name for the column, if one exists.- Parameters:
i
- the column number (starting with 0)- Returns:
- the schema name or null
-
getTableName
Description copied from interface:ResultInterface
Get the table name for the column, if one exists.- Parameters:
i
- the column number (starting with 0)- Returns:
- the table name or null
-
getColumnName
Description copied from interface:ResultInterface
Get the column name.- Parameters:
i
- the column number (starting with 0)- Returns:
- the column name
-
getColumnType
Description copied from interface:ResultInterface
Get the column data type.- Parameters:
i
- the column number (starting with 0)- Returns:
- the column data type
-
isIdentity
public boolean isIdentity(int i) Description copied from interface:ResultInterface
Check if this is an identity column.- Parameters:
i
- the column number (starting with 0)- Returns:
- true for identity columns
-
getNullable
public int getNullable(int i) Description copied from interface:ResultInterface
Check if this column is nullable.- Parameters:
i
- the column number (starting with 0)- Returns:
- Column.NULLABLE_*
-
reset
public void reset()Description copied from interface:ResultInterface
Go to the beginning of the result, that means before the first row. -
getVisibleColumnCount
public int getVisibleColumnCount()Description copied from interface:ResultInterface
Get the number of visible columns. More columns may exist internally for sorting or grouping.- Returns:
- the number of columns
-
getRowCount
public long getRowCount()Description copied from interface:ResultInterface
Get the number of rows in this object.- Returns:
- the number of rows
-
hasNext
public boolean hasNext()Description copied from interface:ResultInterface
Check if this result has more rows to fetch.- Returns:
- true if it has
-
sendClose
private void sendClose() -
close
public void close()Description copied from interface:ResultInterface
Close the result and delete any temporary files -
remapIfOld
private void remapIfOld() -
fetchAdditionalRows
private void fetchAdditionalRows() -
fetchRows
- Throws:
IOException
-
toString
-
getFetchSize
public int getFetchSize()Description copied from interface:ResultInterface
Get the current fetch size for this result set.- Returns:
- the fetch size
-
setFetchSize
public void setFetchSize(int fetchSize) Description copied from interface:ResultInterface
Set the fetch size for this result set.- Parameters:
fetchSize
- the new fetch size
-
isClosed
public boolean isClosed()Description copied from interface:ResultInterface
Check if this result set is closed.- Returns:
- true if it is
-