groovy.sql
Class GroovyResultSet

java.lang.Object
  extended bygroovy.lang.GroovyObjectSupport
      extended bygroovy.sql.GroovyResultSet
All Implemented Interfaces:
GroovyObject

public class GroovyResultSet
extends GroovyObjectSupport

Represents an extent of objects

Version:
$Revision: 1.4 $
Author:
Chris Stevenson, James Strachan

Constructor Summary
GroovyResultSet(java.sql.ResultSet resultSet)
           
 
Method Summary
 void add(java.util.Map values)
          Adds a new row to this result set
 java.lang.Object getAt(int index)
          Supports integer based subscript operators for accessing at numbered columns starting at zero.
 java.lang.Object getProperty(java.lang.String property)
           
 boolean next()
          Iterates to the next row
protected  int normalizeIndex(int index)
          Takes a zero based index and convert it into an SQL based 1 based index.
 boolean previous()
          Moves to the previous row
 void putAt(int index, java.lang.Object newValue)
          Supports integer based subscript operators for updating the values of numbered columns starting at zero.
 void setProperty(java.lang.String property, java.lang.Object newValue)
          Sets the given property to the new value
 
Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, invokeMethod, setMetaClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroovyResultSet

public GroovyResultSet(java.sql.ResultSet resultSet)
Method Detail

getProperty

public java.lang.Object getProperty(java.lang.String property)
Specified by:
getProperty in interface GroovyObject
Overrides:
getProperty in class GroovyObjectSupport

setProperty

public void setProperty(java.lang.String property,
                        java.lang.Object newValue)
Description copied from interface: GroovyObject
Sets the given property to the new value

Specified by:
setProperty in interface GroovyObject
Overrides:
setProperty in class GroovyObjectSupport

next

public boolean next()
             throws java.sql.SQLException
Iterates to the next row

Throws:
java.sql.SQLException

previous

public boolean previous()
                 throws java.sql.SQLException
Moves to the previous row

Throws:
java.sql.SQLException

getAt

public java.lang.Object getAt(int index)
                       throws java.sql.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:
Throws:
java.sql.SQLException

putAt

public void putAt(int index,
                  java.lang.Object newValue)
           throws java.sql.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
Returns:
Throws:
java.sql.SQLException

add

public void add(java.util.Map values)
         throws java.sql.SQLException
Adds a new row to this result set

Parameters:
values -
Throws:
java.sql.SQLException

normalizeIndex

protected int normalizeIndex(int index)
                      throws java.sql.SQLException
Takes a zero based index and convert it into an SQL based 1 based index. A negative index will count backwards from the last column.

Parameters:
index -
Returns:
a JDBC index
Throws:
java.sql.SQLException - if some exception occurs finding out the column count


Copyright © 2003-2004 The Codehaus. All Rights Reserved.