org.glite.rgma
Interface ResultSet


public interface ResultSet

A set of tuples, modelled on the java.sql.ResultSet and providing a subset of its functionality. Note that the behaviour of java.sql.ResultSet is not always completely intuitive and consequently this class has been tailored carefully to match it.


Method Summary
 void afterLast()
          Moves the cursor to the end of this ResultSet object, just after the last row.
 void beforeFirst()
          Moves the cursor to the front of this ResultSet object, just before the first row.
 boolean endOfResults()
          Reports whether this ResultSet is the last one to be returned by a Consumer.
 int findColumn(java.lang.String columnName)
          Maps the given ResultSet column name to its ResultSet column index.
 boolean first()
          Moves the cursor to the first row in this ResultSet object.
 boolean getBoolean(int columnIndex)
          Retrieves the value of the designated column in the current row of this ResultSet object as an boolean in the Java programming language.
 boolean getBoolean(java.lang.String columnName)
          Retrieves the value of the designated column in the current row of this ResultSet object as a boolean in the Java programming language.
 double getDouble(int columnIndex)
          Retrieves the value of the designated column in the current row of this ResultSet object as a double in the Java programming language.
 double getDouble(java.lang.String columnName)
          Retrieves the value of the designated column in the current row of this ResultSet object as a double in the Java programming language.
 float getFloat(int columnIndex)
          Retrieves the value of the designated column in the current row of this ResultSet object as a float in the Java programming language.
 float getFloat(java.lang.String columnName)
          Retrieves the value of the designated column in the current row of this ResultSet object as a float in the Java programming language.
 int getInt(int columnIndex)
          Retrieves the value of the designated column in the current row of this ResultSet object as an int in the Java programming language.
 int getInt(java.lang.String columnName)
          Retrieves the value of the designated column in the current row of this ResultSet object as an int in the Java programming language.
 ResultSetMetaData getMetaData()
          Retrieves the number, types and properties of this ResultSet object's columns.
 int getRow()
          Retrieves the current row number.
 java.lang.String getString(int columnIndex)
          Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language.
 java.lang.String getString(java.lang.String columnName)
          Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language.
 RGMAWarning getWarning()
          Gets the RGMAWarning associated with this ResultSet.
 boolean isAfterLast()
          Retrieves whether the cursor is after the last row in this ResultSet object.
 boolean isBeforeFirst()
          Retrieves whether the cursor is before the first row in this ResultSet object.
 boolean isFirst()
          Retrieves whether the cursor is on the first row of this ResultSet object.
 boolean isLast()
          Retrieves whether the cursor is on the last row of this ResultSet object.
 boolean last()
          Moves the cursor to the last row in this ResultSet object.
 boolean next()
          Moves the cursor down one row from its current position.
 boolean previous()
          Moves the cursor to the previous row in this ResultSet object.
 int size()
          Gets the number of tuples in this ResultSet.
 boolean wasNull()
          Reports whether the last column read had a value of SQL NULL.
 

Method Detail

isAfterLast

public boolean isAfterLast()
Retrieves whether the cursor is after the last row in this ResultSet object.

Returns:
true if the cursor is after the last row; false if the cursor is at any other position or the result set contains no rows

isBeforeFirst

public boolean isBeforeFirst()
Retrieves whether the cursor is before the first row in this ResultSet object.

Returns:
true if the cursor is before the first row; false if the cursor is at any other position or the result set contains no rows

getDouble

public double getDouble(int columnIndex)
                 throws RGMAException
Retrieves the value of the designated column in the current row of this ResultSet object as a double in the Java programming language.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is 0
Throws:
RGMAException - if an RGMA access error occurs

getDouble

public double getDouble(java.lang.String columnName)
                 throws RGMAException
Retrieves the value of the designated column in the current row of this ResultSet object as a double in the Java programming language.

Parameters:
columnName - the SQL name of the column
Returns:
the column value; if the value is SQL NULL, the value returned is 0
Throws:
RGMAException - if an RGMA access error occurs

isFirst

public boolean isFirst()
Retrieves whether the cursor is on the first row of this ResultSet object.

Returns:
true if the cursor is on the first row; false otherwise

getFloat

public float getFloat(int columnIndex)
               throws RGMAException
Retrieves the value of the designated column in the current row of this ResultSet object as a float in the Java programming language.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is 0
Throws:
RGMAException - if an RGMA access error occurs

getFloat

public float getFloat(java.lang.String columnName)
               throws RGMAException
Retrieves the value of the designated column in the current row of this ResultSet object as a float in the Java programming language.

Parameters:
columnName - the SQL name of the column
Returns:
the column value; if the value is SQL NULL, the value returned is 0
Throws:
RGMAException - if an RGMA access error occurs

getInt

public int getInt(int columnIndex)
           throws RGMAException
Retrieves the value of the designated column in the current row of this ResultSet object as an int in the Java programming language.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is 0
Throws:
RGMAException - if an RGMA access error occurs

getInt

public int getInt(java.lang.String columnName)
           throws RGMAException
Retrieves the value of the designated column in the current row of this ResultSet object as an int in the Java programming language.

Parameters:
columnName - the SQL name of the column
Returns:
the column value; if the value is SQL NULL, the value returned is 0
Throws:
RGMAException - if an RGMA access error occurs

getBoolean

public boolean getBoolean(int columnIndex)
                   throws RGMAException
Retrieves the value of the designated column in the current row of this ResultSet object as an boolean in the Java programming language.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is false
Throws:
RGMAException - if an RGMA access error occurs

getBoolean

public boolean getBoolean(java.lang.String columnName)
                   throws RGMAException
Retrieves the value of the designated column in the current row of this ResultSet object as a boolean in the Java programming language.

Parameters:
columnName - the SQL name of the column
Returns:
the column value; if the value is SQL NULL, the value returned is false
Throws:
RGMAException - if an RGMA access error occurs

isLast

public boolean isLast()
Retrieves whether the cursor is on the last row of this ResultSet object. Note: Calling the method isLast may be expensive because the JDBC driver might need to fetch ahead one row in order to determine whether the current row is the last row in the result set.

Returns:
true if the cursor is on the last row; false otherwise

getMetaData

public ResultSetMetaData getMetaData()
Retrieves the number, types and properties of this ResultSet object's columns.

Returns:
the description of this ResultSet object's columns

getRow

public int getRow()
Retrieves the current row number. The first row is number 1, the second number 2, and so on.

Returns:
the current row number; 0 if there is no current row

getString

public java.lang.String getString(int columnIndex)
                           throws RGMAException
Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language.

Parameters:
columnIndex - the first column is 1, the second is 2, ...
Returns:
the column value; if the value is SQL NULL, the value returned is null
Throws:
RGMAException - if an RGMA access error occurs

getString

public java.lang.String getString(java.lang.String columnName)
                           throws RGMAException
Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language.

Parameters:
columnName - the SQL name of the column
Returns:
the column value; if the value is SQL NULL, the value returned is null
Throws:
RGMAException - if an RGMA access error occurs

getWarning

public RGMAWarning getWarning()
Gets the RGMAWarning associated with this ResultSet.

Returns:
The RGMAWarning associated with this ResultSet, or null if no warning has been set.

afterLast

public void afterLast()
Moves the cursor to the end of this ResultSet object, just after the last row. This method has no effect if the result set contains no rows.


beforeFirst

public void beforeFirst()
Moves the cursor to the front of this ResultSet object, just before the first row. This method has no effect if the result set contains no rows.


findColumn

public int findColumn(java.lang.String columnName)
               throws RGMAException
Maps the given ResultSet column name to its ResultSet column index.

Parameters:
columnName - the name of the column
Returns:
the column index of the given column name
Throws:
RGMAException - if theResultSet object does not contain columnName or an RGMA access error occurs

first

public boolean first()
Moves the cursor to the first row in this ResultSet object.

Returns:
true if the cursor is on a valid row; false if there are no rows in the result set

last

public boolean last()
Moves the cursor to the last row in this ResultSet object.

Returns:
true if the cursor is on a valid row; false if there are no rows in the result set

next

public boolean next()
Moves the cursor down one row from its current position. A ResultSet cursor is initially positioned before the first row; the first call to the method next makes the first row the current row; the second call makes the second row the current row, and so on.

If an input stream is open for the current row, a call to the method next will implicitly close it. A ResultSet object's warning chain is cleared when a new row is read.

Returns:
true if the new current row is valid; false if there are no more rows

previous

public boolean previous()
Moves the cursor to the previous row in this ResultSet object.

Returns:
true if the cursor is on a valid row; false if it is off the result set

wasNull

public boolean wasNull()
Reports whether the last column read had a value of SQL NULL. Note that you must first call one of the getter methods on a column to try to read its value and then call the method wasNull to see if the value read was SQL NULL.

Returns:
true if the last column value read was SQL NULL and false otherwise

endOfResults

public boolean endOfResults()
Reports whether this ResultSet is the last one to be returned by a Consumer.

Returns:
true if there are no more ResultSets that need to be popped for this query.

size

public int size()
Gets the number of tuples in this ResultSet.

Returns:
The number of tuples in this ResultSet.