public interface QueryResultIF extends AutoCloseable
The query result object always has a current row in the result (except before the first call to next()), and the getValue(int ix) method will return the value in column ix of this row. To find the column number for a particular variable, call getIndex("VAR"); alternatively, call getValue("VAR") directly.
The next() method is used to simultaneously step to the next row and check if there is a next row.
Modifier and Type | Method and Description |
---|---|
void |
close()
PUBLIC: Closes the query result, which allows it to free its
resources.
|
String |
getColumnName(int ix)
PUBLIC: Returns the name of the given column.
|
String[] |
getColumnNames()
PUBLIC: Returns the names of the columns.
|
int |
getIndex(String colname)
PUBLIC: Returns the index of the named column.
|
Object |
getValue(int ix)
PUBLIC: Returns the value in the given column in the current
match.
|
Object |
getValue(String colname)
PUBLIC: Returns the value in the given column in the current
match.
|
Object[] |
getValues()
PUBLIC: Returns the current match as an array of values.
|
Object[] |
getValues(Object[] values)
PUBLIC: Reads the values of the current match into the specified
array.
|
int |
getWidth()
PUBLIC: Returns the number of columns in the result.
|
boolean |
next()
PUBLIC: Steps to the next match, returning true if a valid match
was found, and false if there are no more matches.
|
boolean next()
int getWidth()
int getIndex(String colname)
String[] getColumnNames()
String getColumnName(int ix)
IndexOutOfBoundsException
- if there is no such column.Object getValue(int ix)
next()
to have been called first.IndexOutOfBoundsException
- if there is no such column.Object getValue(String colname)
next()
to have been called first.IllegalArgumentException
- if there is no such column.Object[] getValues()
next()
to have been
called first.Object[] getValues(Object[] values)
next()
to have been called first.void close()
close
in interface AutoCloseable