org.h2.result
Class ResultRemote

java.lang.Object
  extended by org.h2.result.ResultRemote
All Implemented Interfaces:
ResultInterface

public class ResultRemote
extends java.lang.Object
implements 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.


Constructor Summary
ResultRemote(SessionRemote session, Transfer transfer, int id, int columnCount, int fetchSize)
           
 
Method Summary
 void close()
          Close the result and delete any temporary files
 Value[] currentRow()
          Get the current row.
 java.lang.String getAlias(int i)
          Get the column alias name for the column.
 java.lang.String getColumnName(int i)
          Get the column name.
 long getColumnPrecision(int i)
          Get the precision for this column.
 int getColumnScale(int i)
          Get the scale for this column.
 int getColumnType(int i)
          Get the column data type.
 int getDisplaySize(int i)
          Get the display size for this column.
 int getFetchSize()
          Get the current fetch size for this result set.
 int getNullable(int i)
          Check if this column is nullable.
 int getRowCount()
          Get the number of rows in this object.
 int getRowId()
          Get the current row id, starting with 0.
 java.lang.String getSchemaName(int i)
          Get the schema name for the column, if one exists.
 java.lang.String getTableName(int i)
          Get the table name for the column, if one exists.
 int getVisibleColumnCount()
          Get the number of visible columns.
 boolean isAutoIncrement(int i)
          Check if this is an auto-increment column.
 boolean needToClose()
          Check if this result set should be closed, for example because it is buffered using a temporary file.
 boolean next()
          Go to the next row.
 void reset()
          Go to the beginning of the result, that means before the first row.
 void setFetchSize(int fetchSize)
          Set the fetch size for this result set.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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

getAlias

public java.lang.String getAlias(int i)
Description copied from interface: ResultInterface
Get the column alias name for the column.

Specified by:
getAlias in interface ResultInterface
Parameters:
i - the column number (starting with 0)
Returns:
the alias name

getSchemaName

public java.lang.String getSchemaName(int i)
Description copied from interface: ResultInterface
Get the schema name for the column, if one exists.

Specified by:
getSchemaName in interface ResultInterface
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: ResultInterface
Get the table name for the column, if one exists.

Specified by:
getTableName in interface ResultInterface
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: ResultInterface
Get the column name.

Specified by:
getColumnName in interface ResultInterface
Parameters:
i - the column number (starting with 0)
Returns:
the column name

getColumnType

public int getColumnType(int i)
Description copied from interface: ResultInterface
Get the column data type.

Specified by:
getColumnType in interface ResultInterface
Parameters:
i - the column number (starting with 0)
Returns:
the column data type

getColumnPrecision

public long getColumnPrecision(int i)
Description copied from interface: ResultInterface
Get the precision for this column.

Specified by:
getColumnPrecision in interface ResultInterface
Parameters:
i - the column number (starting with 0)
Returns:
the precision

getColumnScale

public int getColumnScale(int i)
Description copied from interface: ResultInterface
Get the scale for this column.

Specified by:
getColumnScale in interface ResultInterface
Parameters:
i - the column number (starting with 0)
Returns:
the scale

getDisplaySize

public int getDisplaySize(int i)
Description copied from interface: ResultInterface
Get the display size for this column.

Specified by:
getDisplaySize in interface ResultInterface
Parameters:
i - the column number (starting with 0)
Returns:
the display size

isAutoIncrement

public boolean isAutoIncrement(int i)
Description copied from interface: ResultInterface
Check if this is an auto-increment column.

Specified by:
isAutoIncrement in interface ResultInterface
Parameters:
i - the column number (starting with 0)
Returns:
true for auto-increment columns

getNullable

public int getNullable(int i)
Description copied from interface: ResultInterface
Check if this column is nullable.

Specified by:
getNullable in interface ResultInterface
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.

Specified by:
reset in interface ResultInterface

currentRow

public Value[] currentRow()
Description copied from interface: ResultInterface
Get the current row.

Specified by:
currentRow in interface ResultInterface
Returns:
the row

next

public boolean next()
Description copied from interface: ResultInterface
Go to the next row.

Specified by:
next in interface ResultInterface
Returns:
true if a row exists

getRowId

public int getRowId()
Description copied from interface: ResultInterface
Get the current row id, starting with 0. -1 is returned when next() was not called yet.

Specified by:
getRowId in interface ResultInterface
Returns:
the row id

getVisibleColumnCount

public int getVisibleColumnCount()
Description copied from interface: ResultInterface
Get the number of visible columns. More columns may exist internally for sorting or grouping.

Specified by:
getVisibleColumnCount in interface ResultInterface
Returns:
the number of columns

getRowCount

public int getRowCount()
Description copied from interface: ResultInterface
Get the number of rows in this object.

Specified by:
getRowCount in interface ResultInterface
Returns:
the number of rows

close

public void close()
Description copied from interface: ResultInterface
Close the result and delete any temporary files

Specified by:
close in interface ResultInterface

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getFetchSize

public int getFetchSize()
Description copied from interface: ResultInterface
Get the current fetch size for this result set.

Specified by:
getFetchSize in interface ResultInterface
Returns:
the fetch size

setFetchSize

public void setFetchSize(int fetchSize)
Description copied from interface: ResultInterface
Set the fetch size for this result set.

Specified by:
setFetchSize in interface ResultInterface
Parameters:
fetchSize - the new fetch size

needToClose

public boolean needToClose()
Description copied from interface: ResultInterface
Check if this result set should be closed, for example because it is buffered using a temporary file.

Specified by:
needToClose in interface ResultInterface
Returns:
true if close should be called.