Package org.h2.result
Class ResultRemote
- java.lang.Object
-
- org.h2.result.FetchedResult
-
- org.h2.result.ResultRemote
-
- All Implemented Interfaces:
java.lang.AutoCloseable,ResultInterface
public final class ResultRemote extends FetchedResult
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
Fields Modifier and Type Field Description private ResultColumn[]columnsprivate intfetchSizeprivate intidprivate java.util.ArrayList<Value[]>resultprivate longrowCountprivate longrowOffsetprivate SessionRemotesessionprivate Tracetraceprivate Transfertransfer-
Fields inherited from class org.h2.result.FetchedResult
afterLast, currentRow, nextRow, rowId
-
-
Constructor Summary
Constructors Constructor Description ResultRemote(SessionRemote session, Transfer transfer, int id, int columnCount, int fetchSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the result and delete any temporary filesprivate voidfetchAdditionalRows()private booleanfetchRows(int fetch)java.lang.StringgetAlias(int i)Get the column alias name for the column.java.lang.StringgetColumnName(int i)Get the column name.TypeInfogetColumnType(int i)Get the column data type.intgetFetchSize()Get the current fetch size for this result set.intgetNullable(int i)Check if this column is nullable.longgetRowCount()Get the number of rows in this object.java.lang.StringgetSchemaName(int i)Get the schema name for the column, if one exists.java.lang.StringgetTableName(int i)Get the table name for the column, if one exists.intgetVisibleColumnCount()Get the number of visible columns.booleanhasNext()Check if this result has more rows to fetch.booleanisClosed()Check if this result set is closed.booleanisIdentity(int i)Check if this is an identity column.booleanisLazy()Check if this a lazy execution result.private voidremapIfOld()voidreset()Go to the beginning of the result, that means before the first row.private voidsendClose()voidsetFetchSize(int fetchSize)Set the fetch size for this result set.java.lang.StringtoString()-
Methods inherited from class org.h2.result.FetchedResult
createShallowCopy, currentRow, getRowId, isAfterLast, needToClose, next
-
-
-
-
Field Detail
-
fetchSize
private int fetchSize
-
session
private SessionRemote session
-
transfer
private Transfer transfer
-
id
private int id
-
columns
private final ResultColumn[] columns
-
rowCount
private long rowCount
-
rowOffset
private long rowOffset
-
result
private java.util.ArrayList<Value[]> result
-
trace
private final Trace trace
-
-
Constructor Detail
-
ResultRemote
public ResultRemote(SessionRemote session, Transfer transfer, int id, int columnCount, int fetchSize) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
isLazy
public boolean isLazy()
Description copied from interface:ResultInterfaceCheck if this a lazy execution result.- Returns:
- true if it is a lazy result
-
getAlias
public java.lang.String getAlias(int i)
Description copied from interface:ResultInterfaceGet the column alias name for the column.- Parameters:
i- the column number (starting with 0)- Returns:
- the alias name
-
getSchemaName
public java.lang.String getSchemaName(int i)
Description copied from interface:ResultInterfaceGet the schema name for the column, if one exists.- Parameters:
i- the column number (starting with 0)- Returns:
- the schema name or null
-
getTableName
public java.lang.String getTableName(int i)
Description copied from interface:ResultInterfaceGet the table name for the column, if one exists.- Parameters:
i- the column number (starting with 0)- Returns:
- the table name or null
-
getColumnName
public java.lang.String getColumnName(int i)
Description copied from interface:ResultInterfaceGet the column name.- Parameters:
i- the column number (starting with 0)- Returns:
- the column name
-
getColumnType
public TypeInfo getColumnType(int i)
Description copied from interface:ResultInterfaceGet 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:ResultInterfaceCheck 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:ResultInterfaceCheck if this column is nullable.- Parameters:
i- the column number (starting with 0)- Returns:
- Column.NULLABLE_*
-
reset
public void reset()
Description copied from interface:ResultInterfaceGo to the beginning of the result, that means before the first row.
-
getVisibleColumnCount
public int getVisibleColumnCount()
Description copied from interface:ResultInterfaceGet 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:ResultInterfaceGet the number of rows in this object.- Returns:
- the number of rows
-
hasNext
public boolean hasNext()
Description copied from interface:ResultInterfaceCheck 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:ResultInterfaceClose the result and delete any temporary files
-
remapIfOld
private void remapIfOld()
-
fetchAdditionalRows
private void fetchAdditionalRows()
-
fetchRows
private boolean fetchRows(int fetch) throws java.io.IOException- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getFetchSize
public int getFetchSize()
Description copied from interface:ResultInterfaceGet the current fetch size for this result set.- Returns:
- the fetch size
-
setFetchSize
public void setFetchSize(int fetchSize)
Description copied from interface:ResultInterfaceSet the fetch size for this result set.- Parameters:
fetchSize- the new fetch size
-
isClosed
public boolean isClosed()
Description copied from interface:ResultInterfaceCheck if this result set is closed.- Returns:
- true if it is
-
-