public class Cursor
extends java.lang.Object
Cursor
has at least one row.
This class is not thread safe.Constructor and Description |
---|
Cursor() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the cursor.
|
boolean |
first()
Moves the cursor to the first row.
|
byte[] |
getBlob(int index)
Returns the value of requested column as a byte array.
|
int |
getColumnIndex(java.lang.String columnName)
Note that on some platforms the meta information are available only, if the
Cursor has at least one row. |
java.lang.String |
getColumnName(int columnIndex)
Returns the column name of the given zero-based index.
|
java.lang.String[] |
getColumnNames()
Note that on some platforms the meta information are available only, if the
Cursor has at least one row. |
int |
getCount()
Note that on some platforms the meta information are available only, if the
Cursor has at least one row. |
double |
getDouble(int index)
Return the value of requested column as a double.
|
long |
getLong(int index)
Returns the value of requested column as a long.
|
int |
getPosition() |
java.lang.String |
getString(int index)
Returns the value of requested column as a String.
|
boolean |
last()
Moves the cursor to the last row.
|
boolean |
moveTo(int rowIndex)
Moves the cursor to an absolute postion.
|
boolean |
next()
Moves the cursor to the next row.
|
boolean |
prev()
Moves the cursor to the previous row.
|
public boolean first() throws DatabaseException
DatabaseException
- if the cursor is closed.public boolean last() throws DatabaseException
DatabaseException
- if the cursor is closed.public boolean next() throws DatabaseException
DatabaseException
- if the cursor is closed.public boolean prev() throws DatabaseException
DatabaseException
- if the cursor is closed.public boolean moveTo(int rowIndex) throws DatabaseException
rowIndex
- DatabaseException
- if the cursor is closed.public int getPosition() throws DatabaseException
DatabaseException
- if the cursor is closed.public int getColumnIndex(java.lang.String columnName) throws DatabaseException
Cursor
has at least one row.columnName
- DatabaseException
public java.lang.String getColumnName(int columnIndex) throws DatabaseException
Cursor
has at least one row.columnIndex
- DatabaseException
public int getCount() throws DatabaseException
Cursor
has at least one row.DatabaseException
public java.lang.String[] getColumnNames() throws DatabaseException
Cursor
has at least one row.
returns an array of column namesDatabaseException
public byte[] getBlob(int index) throws DatabaseException
index
- - zero-based indexDatabaseException
public double getDouble(int index) throws DatabaseException
index
- - the zero-based indexDatabaseException
public long getLong(int index) throws DatabaseException
index
- - the zero-based indexDatabaseException
public java.lang.String getString(int index) throws DatabaseException
index
- - the zero-based indexDatabaseException
public void close() throws DatabaseException
DatabaseException
- if the Cursor
is already closed.