com.j256.ormlite.support
Interface DatabaseResults


public interface DatabaseResults

A reduction of the SQL ResultSet so we can implement it outside of JDBC.

NOTE: In all cases, the columnIndex parameters are 0 based -- not 1 based like JDBC.

Author:
graywatson

Method Summary
 int findColumn(String columnName)
          Return the column index associated with the column name.
 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.
 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.
 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 next()
          Moves to the next result.
 boolean wasNull(int columnIndex)
          Returns true if the last object returned with the column index is null.
 

Method Detail

getColumnCount

int getColumnCount()
                   throws SQLException
Returns the number of columns in these results.

Throws:
SQLException

next

boolean next()
             throws SQLException
Moves to the next result.

Returns:
true if there are more results to be processed.
Throws:
SQLException

findColumn

int findColumn(String columnName)
               throws SQLException
Return the column index associated with the column name.

Throws:
SQLException - if the column was not found in the results.

getString

String getString(int columnIndex)
                 throws SQLException
Returns the string from the results at the column index.

Throws:
SQLException

getBoolean

boolean getBoolean(int columnIndex)
                   throws SQLException
Returns the boolean value from the results at the column index.

Throws:
SQLException

getChar

char getChar(int columnIndex)
             throws SQLException
Returns the char value from the results at the column index.

Throws:
SQLException

getByte

byte getByte(int columnIndex)
             throws SQLException
Returns the byte value from the results at the column index.

Throws:
SQLException

getBytes

byte[] getBytes(int columnIndex)
                throws SQLException
Returns the byte array value from the results at the column index.

Throws:
SQLException

getShort

short getShort(int columnIndex)
               throws SQLException
Returns the short value from the results at the column index.

Throws:
SQLException

getInt

int getInt(int columnIndex)
           throws SQLException
Returns the integer value from the results at the column index.

Throws:
SQLException

getLong

long getLong(int columnIndex)
             throws SQLException
Returns the long value from the results at the column index.

Throws:
SQLException

getFloat

float getFloat(int columnIndex)
               throws SQLException
Returns the float value from the results at the column index.

Throws:
SQLException

getDouble

double getDouble(int columnIndex)
                 throws SQLException
Returns the double value from the results at the column index.

Throws:
SQLException

getTimestamp

Timestamp getTimestamp(int columnIndex)
                       throws SQLException
Returns the SQL timestamp value from the results at the column index.

Throws:
SQLException

getBlobStream

InputStream getBlobStream(int columnIndex)
                          throws SQLException
Returns an input stream for a blob value from the results at the column index.

Throws:
SQLException

wasNull

boolean wasNull(int columnIndex)
                throws SQLException
Returns true if the last object returned with the column index is null.

Throws:
SQLException


Copyright © 2011. All Rights Reserved.