Package groovy.sql

Interface GroovyResultSet

All Superinterfaces:
AutoCloseable, GroovyObject, ResultSet, Wrapper

public interface GroovyResultSet extends GroovyObject, ResultSet
Represents an extent of objects
  • Method Details

    • getAt

      Object getAt(int index) throws SQLException
      Supports integer-based subscript operators for accessing at numbered columns starting at zero. Negative indices are supported, they will count from the last column backwards.
      Parameters:
      index - is the number of the column to look at starting at 1
      Returns:
      the object for this index in the current result set
      Throws:
      SQLException - if a database error occurs
    • getAt

      Object getAt(String columnName)
      Gets the value of the designated column in the current row as an Object.
      Parameters:
      columnName - the SQL name of the column
      Returns:
      the returned column value
      Throws:
      MissingPropertyException - if an SQLException happens while getting the object
    • putAt

      void putAt(int index, Object newValue) throws SQLException
      Supports integer based subscript operators for updating the values of numbered columns starting at zero. Negative indices are supported, they will count from the last column backwards.
      Parameters:
      index - is the number of the column to look at starting at 1
      newValue - the new value for this index
      Throws:
      SQLException - if a database error occurs
    • putAt

      void putAt(String columnName, Object newValue)
      Updates the designated column with an Object value.
      Parameters:
      columnName - the SQL name of the column
      newValue - the updated value
      Throws:
      MissingPropertyException - if an SQLException happens while setting the new value
    • add

      void add(Map values) throws SQLException
      Adds a new row to this result set
      Parameters:
      values - the new values to add
      Throws:
      SQLException - if a database error occurs
    • eachRow

      void eachRow(Closure closure) throws SQLException
      Call the closure once for each row in the result set.
      Parameters:
      closure - the closure to call for each row
      Throws:
      SQLException - if a database error occurs