|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.result.LocalResult
public class LocalResult
A local result set contains all row data of a result set. This is the object generated by engine, and it is also used directly by the ResultSet class in the embedded mode. If the result does not fit in memory, it is written to a temporary file.
Constructor Summary | |
---|---|
LocalResult()
Construct a local result object. |
|
LocalResult(Session session,
Expression[] expressions,
int visibleColumnCount)
Construct a local result object. |
|
LocalResult(Session session,
ObjectArray<Expression> expressionList,
int visibleColumnCount)
Construct a local result object. |
Method Summary | |
---|---|
void |
addRow(Value[] values)
Add a row to this object. |
void |
close()
Close the result and delete any temporary files |
boolean |
containsDistinct(Value[] values)
Check if this result set contains the given row. |
LocalResult |
createShallowCopy(Session session)
Create a shallow copy of the result set. |
Value[] |
currentRow()
Get the current row. |
void |
done()
This method is called after all rows have been added. |
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 |
isClosed()
Check if this result set is closed. |
boolean |
needToClose()
Check if this result set is buffered using a temporary file. |
boolean |
next()
Go to the next row. |
static LocalResult |
read(Session session,
java.sql.ResultSet rs,
int maxrows)
Construct a local result set by reading all data from a regular result set. |
void |
removeDistinct(Value[] values)
Remove the row from the result set if it exists. |
void |
reset()
Go to the beginning of the result, that means before the first row. |
void |
setDistinct()
Remove duplicate rows. |
void |
setFetchSize(int fetchSize)
Set the fetch size for this result set. |
void |
setLimit(int limit)
Set the number of rows that this result will return at the maximum. |
void |
setOffset(int offset)
Set the offset of the first row to return. |
void |
setSortOrder(SortOrder sort)
Set the sort order. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LocalResult()
public LocalResult(Session session, Expression[] expressions, int visibleColumnCount)
session
- the sessionexpressions
- the expression arrayvisibleColumnCount
- the number of visible columnspublic LocalResult(Session session, ObjectArray<Expression> expressionList, int visibleColumnCount)
session
- the sessionexpressionList
- the expression listvisibleColumnCount
- the number of visible columnsMethod Detail |
---|
public static LocalResult read(Session session, java.sql.ResultSet rs, int maxrows) throws java.sql.SQLException
session
- the sessionrs
- the result setmaxrows
- the maximum number of rows to read (0 for no limit)
java.sql.SQLException
public LocalResult createShallowCopy(Session session)
session
- the session
public void setSortOrder(SortOrder sort)
sort
- the sort orderpublic void setDistinct()
public void removeDistinct(Value[] values) throws java.sql.SQLException
values
- the row
java.sql.SQLException
public boolean containsDistinct(Value[] values) throws java.sql.SQLException
values
- the row
java.sql.SQLException
public void reset() throws java.sql.SQLException
ResultInterface
reset
in interface ResultInterface
java.sql.SQLException
public Value[] currentRow()
ResultInterface
currentRow
in interface ResultInterface
public boolean next() throws java.sql.SQLException
ResultInterface
next
in interface ResultInterface
java.sql.SQLException
public int getRowId()
ResultInterface
getRowId
in interface ResultInterface
public void addRow(Value[] values) throws java.sql.SQLException
values
- the row to add
java.sql.SQLException
public int getVisibleColumnCount()
ResultInterface
getVisibleColumnCount
in interface ResultInterface
public void done() throws java.sql.SQLException
java.sql.SQLException
public int getRowCount()
ResultInterface
getRowCount
in interface ResultInterface
public void setLimit(int limit)
limit
- the limitpublic boolean needToClose()
public void close()
ResultInterface
close
in interface ResultInterface
public java.lang.String getAlias(int i)
ResultInterface
getAlias
in interface ResultInterface
i
- the column number (starting with 0)
public java.lang.String getTableName(int i)
ResultInterface
getTableName
in interface ResultInterface
i
- the column number (starting with 0)
public java.lang.String getSchemaName(int i)
ResultInterface
getSchemaName
in interface ResultInterface
i
- the column number (starting with 0)
public int getDisplaySize(int i)
ResultInterface
getDisplaySize
in interface ResultInterface
i
- the column number (starting with 0)
public java.lang.String getColumnName(int i)
ResultInterface
getColumnName
in interface ResultInterface
i
- the column number (starting with 0)
public int getColumnType(int i)
ResultInterface
getColumnType
in interface ResultInterface
i
- the column number (starting with 0)
public long getColumnPrecision(int i)
ResultInterface
getColumnPrecision
in interface ResultInterface
i
- the column number (starting with 0)
public int getNullable(int i)
ResultInterface
getNullable
in interface ResultInterface
i
- the column number (starting with 0)
public boolean isAutoIncrement(int i)
ResultInterface
isAutoIncrement
in interface ResultInterface
i
- the column number (starting with 0)
public int getColumnScale(int i)
ResultInterface
getColumnScale
in interface ResultInterface
i
- the column number (starting with 0)
public void setOffset(int offset)
offset
- the offsetpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean isClosed()
public int getFetchSize()
ResultInterface
getFetchSize
in interface ResultInterface
public void setFetchSize(int fetchSize)
ResultInterface
setFetchSize
in interface ResultInterface
fetchSize
- the new fetch size
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |