Top Description Methods
org.h2.result

public Interface ResultInterface

extends AutoCloseable
Known Direct Implementers
org.h2.result.ResultWithPaddedStrings, org.h2.result.SimpleResult, org.h2.result.FetchedResult, org.h2.result.LocalResult
Imports
org.h2.engine.Session, org.h2.value.TypeInfo, .Value

The result interface is used by the LocalResult and ResultRemote class. A result may contain rows, or just an update count.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Redeclares java.lang.AutoCloseable.close.

Close the result and delete any temporary files

public ResultInterface

Returns:

the copy if possible, or null if copying is not possible
createShallowCopy
(Session
the session of the copy
targetSession
)

Create a shallow copy of the result set.

public Value[]

Returns:

the row
currentRow
()

Get the current row.

public String

Returns:

the alias name
getAlias
(int
the column number (starting with 0)
i
)

Get the column alias name for the column.

public String

Returns:

the column name
getColumnName
(int
the column number (starting with 0)
i
)

Get the column name.

public TypeInfo

Returns:

the column data type
getColumnType
(int
the column number (starting with 0)
i
)

Get the column data type.

public int

Returns:

the fetch size
getFetchSize
()

Get the current fetch size for this result set.

public int

Returns:

Column.NULLABLE_*
getNullable
(int
the column number (starting with 0)
i
)

Check if this column is nullable.

public long

Returns:

the number of rows
getRowCount
()

Get the number of rows in this object.

public long

Returns:

the row id
getRowId
()

Get the current row id, starting with 0.

public String

Returns:

the schema name or null
getSchemaName
(int
the column number (starting with 0)
i
)

Get the schema name for the column, if one exists.

public String

Returns:

the table name or null
getTableName
(int
the column number (starting with 0)
i
)

Get the table name for the column, if one exists.

public int

Returns:

the number of columns
getVisibleColumnCount
()

Get the number of visible columns.

public boolean

Returns:

true if it has
hasNext
()

Check if this result has more rows to fetch.

public boolean

Returns:

true if after last
isAfterLast
()

Check if the current position is after last row.

public boolean

Returns:

true if it is
isClosed
()

Check if this result set is closed.

public boolean

Returns:

true for identity columns
isIdentity
(int
the column number (starting with 0)
i
)

Check if this is an identity column.

public boolean

Returns:

true if it is a lazy result
isLazy
()

Check if this a lazy execution result.

public boolean

Returns:

true if close should be called.
needToClose
()

Check if this result set should be closed, for example because it is buffered using a temporary file.

public boolean

Returns:

true if a row exists
next
()

Go to the next row.

public void
reset()

Go to the beginning of the result, that means before the first row.

public void
setFetchSize(int
the new fetch size
fetchSize
)

Set the fetch size for this result set.

Method Detail

closeback to summary
public void close()

Redeclares java.lang.AutoCloseable.close.

Close the result and delete any temporary files

Annotations
@Override
createShallowCopyback to summary
public ResultInterface createShallowCopy(Session targetSession)

Create a shallow copy of the result set. The data and a temporary table (if there is any) is not copied.

Parameters
targetSession:Session

the session of the copy

Returns:ResultInterface

the copy if possible, or null if copying is not possible

currentRowback to summary
public Value[] currentRow()

Get the current row.

Returns:Value[]

the row

getAliasback to summary
public String getAlias(int i)

Get the column alias name for the column.

Parameters
i:int

the column number (starting with 0)

Returns:String

the alias name

getColumnNameback to summary
public String getColumnName(int i)

Get the column name.

Parameters
i:int

the column number (starting with 0)

Returns:String

the column name

getColumnTypeback to summary
public TypeInfo getColumnType(int i)

Get the column data type.

Parameters
i:int

the column number (starting with 0)

Returns:TypeInfo

the column data type

getFetchSizeback to summary
public int getFetchSize()

Get the current fetch size for this result set.

Returns:int

the fetch size

getNullableback to summary
public int getNullable(int i)

Check if this column is nullable.

Parameters
i:int

the column number (starting with 0)

Returns:int

Column.NULLABLE_*

getRowCountback to summary
public long getRowCount()

Get the number of rows in this object.

Returns:long

the number of rows

getRowIdback to summary
public long getRowId()

Get the current row id, starting with 0. -1 is returned when next() was not called yet.

Returns:long

the row id

getSchemaNameback to summary
public String getSchemaName(int i)

Get the schema name for the column, if one exists.

Parameters
i:int

the column number (starting with 0)

Returns:String

the schema name or null

getTableNameback to summary
public String getTableName(int i)

Get the table name for the column, if one exists.

Parameters
i:int

the column number (starting with 0)

Returns:String

the table name or null

getVisibleColumnCountback to summary
public int getVisibleColumnCount()

Get the number of visible columns. More columns may exist internally for sorting or grouping.

Returns:int

the number of columns

hasNextback to summary
public boolean hasNext()

Check if this result has more rows to fetch.

Returns:boolean

true if it has

isAfterLastback to summary
public boolean isAfterLast()

Check if the current position is after last row.

Returns:boolean

true if after last

isClosedback to summary
public boolean isClosed()

Check if this result set is closed.

Returns:boolean

true if it is

isIdentityback to summary
public boolean isIdentity(int i)

Check if this is an identity column.

Parameters
i:int

the column number (starting with 0)

Returns:boolean

true for identity columns

isLazyback to summary
public boolean isLazy()

Check if this a lazy execution result.

Returns:boolean

true if it is a lazy result

needToCloseback to summary
public boolean needToClose()

Check if this result set should be closed, for example because it is buffered using a temporary file.

Returns:boolean

true if close should be called.

nextback to summary
public boolean next()

Go to the next row.

Returns:boolean

true if a row exists

resetback to summary
public void reset()

Go to the beginning of the result, that means before the first row.

setFetchSizeback to summary
public void setFetchSize(int fetchSize)

Set the fetch size for this result set.

Parameters
fetchSize:int

the new fetch size