public interface Cursor
The Cursor interface is used to iterate over the results returned from a database query.
IMPORTANT: Notice that some methods might not be supported on all platforms!
There is more thorough coverage of the Database API here
.
The sample code below presents a Database Explorer tool that allows executing arbitrary SQL and viewing the tabular results:
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the cursor and release its resources
|
boolean |
first()
Move the cursor to the first row.
|
int |
getColumnCount()
Returns the column count
|
int |
getColumnIndex(String columnName)
Returns the zero-based index for a given column name.
|
String |
getColumnName(int columnIndex)
Returns the column name at a given zero-based column index.
|
int |
getPosition()
Returns the current Cursor position.
|
Row |
getRow()
Get the Row data Object.
|
boolean |
last()
Move the cursor to the last row.
|
boolean |
next()
Moves the cursor to the next row.
|
boolean |
position(int row)
Move the cursor to an absolute row position
|
boolean |
prev()
Moves the cursor to the previous row.
|
boolean first() throws IOException
IOException
boolean last() throws IOException
IOException
boolean next() throws IOException
IOException
boolean prev() throws IOException
IOException
int getColumnIndex(String columnName) throws IOException
columnName
- the name of the column.IOException
String getColumnName(int columnIndex) throws IOException
columnIndex
- the index of the columnIOException
int getColumnCount() throws IOException
IOException
int getPosition() throws IOException
IOException
boolean position(int row) throws IOException
row
- position to move toIOException
void close() throws IOException
IOException
Row getRow() throws IOException
IOException