public interface DatabaseResults extends AutoCloseable
NOTE: In all cases, the columnIndex parameters are 0 based -- not 1 based like JDBC.
| Modifier and Type | Method and Description |
|---|---|
void |
closeQuietly()
Closes any underlying database connections but swallows any SQLExceptions.
|
int |
findColumn(String columnName)
Returns the column index associated with the column name.
|
boolean |
first()
Moves to the first result.
|
BigDecimal |
getBigDecimal(int columnIndex)
Returns the SQL big decimal value from the results at the column index.
|
InputStream |
getBlobStream(int columnIndex)
Returns an input stream for a blob value from the results at the column index.
|
boolean |
getBoolean(int columnIndex)
Returns the boolean value from the results at the column index.
|
byte |
getByte(int columnIndex)
Returns the byte value from the results at the column index.
|
byte[] |
getBytes(int columnIndex)
Returns the byte array value from the results at the column index.
|
char |
getChar(int columnIndex)
Returns the char value from the results at the column index.
|
int |
getColumnCount()
Returns the number of columns in these results.
|
String[] |
getColumnNames()
Returns an array of column names.
|
double |
getDouble(int columnIndex)
Returns the double value from the results at the column index.
|
float |
getFloat(int columnIndex)
Returns the float value from the results at the column index.
|
int |
getInt(int columnIndex)
Returns the integer value from the results at the column index.
|
long |
getLong(int columnIndex)
Returns the long value from the results at the column index.
|
Object |
getObject(int columnIndex)
Returns the SQL object value from the results at the column index.
|
ObjectCache |
getObjectCacheForRetrieve()
Returns the object cache for looking up objects associated with these results or null if none.
|
ObjectCache |
getObjectCacheForStore()
Returns the object cache for storing objects generated by these results or null if none.
|
short |
getShort(int columnIndex)
Returns the short value from the results at the column index.
|
String |
getString(int columnIndex)
Returns the string from the results at the column index.
|
Timestamp |
getTimestamp(int columnIndex)
Returns the SQL timestamp value from the results at the column index.
|
boolean |
last()
Moves to the last result.
|
boolean |
moveAbsolute(int position)
Moves to an absolute position in the list of results.
|
boolean |
moveRelative(int offset)
Moves forward (positive value) or backwards (negative value) the list of results.
|
boolean |
next()
Moves to the next result.
|
boolean |
previous()
Moves to the previous result.
|
boolean |
wasNull(int columnIndex)
Returns true if the last object returned with the column index is null.
|
closeint getColumnCount()
throws SQLException
SQLExceptionString[] getColumnNames() throws SQLException
SQLExceptionboolean first()
throws SQLException
SQLExceptionboolean previous()
throws SQLException
SQLExceptionboolean next()
throws SQLException
SQLExceptionboolean last()
throws SQLException
SQLExceptionboolean moveRelative(int offset)
throws SQLException
next(). moveRelative(-1) is the same as previous() result. This may not work with the
default iterator depending on your database.offset - Number of rows to move. Positive moves forward in the results. Negative moves backwards.SQLExceptionboolean moveAbsolute(int position)
throws SQLException
position - Row number in the result list to move to.SQLExceptionint findColumn(String columnName) throws SQLException
SQLException - if the column was not found in the results.String getString(int columnIndex) throws SQLException
SQLExceptionboolean getBoolean(int columnIndex)
throws SQLException
SQLExceptionchar getChar(int columnIndex)
throws SQLException
SQLExceptionbyte getByte(int columnIndex)
throws SQLException
SQLExceptionbyte[] getBytes(int columnIndex)
throws SQLException
SQLExceptionshort getShort(int columnIndex)
throws SQLException
SQLExceptionint getInt(int columnIndex)
throws SQLException
SQLExceptionlong getLong(int columnIndex)
throws SQLException
SQLExceptionfloat getFloat(int columnIndex)
throws SQLException
SQLExceptiondouble getDouble(int columnIndex)
throws SQLException
SQLExceptionTimestamp getTimestamp(int columnIndex) throws SQLException
SQLExceptionInputStream getBlobStream(int columnIndex) throws SQLException
SQLExceptionBigDecimal getBigDecimal(int columnIndex) throws SQLException
SQLExceptionObject getObject(int columnIndex) throws SQLException
SQLExceptionboolean wasNull(int columnIndex)
throws SQLException
SQLExceptionObjectCache getObjectCacheForRetrieve()
ObjectCache getObjectCacheForStore()
void closeQuietly()
This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.