|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.lang.GroovyObjectSupport groovy.sql.GroovyResultSetExtension
public class GroovyResultSetExtension extends GroovyObjectSupport
GroovyResultSetExtension implements additional logic for ResultSet. Due to the version incompatibility between java6 and java5 this methods are moved here from the original GroovyResultSet class. The methods in this class are used by the proxy GroovyResultSetProxy, which will try to invoke methods on this class before invoking it on ResultSet.
This class is not intended to be used directly. Should be used through GroovyResultSetProxy only!
Constructor Summary | |
GroovyResultSetExtension(java.sql.ResultSet set)
Creates a GroovyResultSet implementation. |
Method Summary | |
---|---|
void
|
add(java.util.Map values)
Adds a new row to the result set |
void
|
eachRow(Closure closure)
Call the closure once for each row in the 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 columnName)
Gets the value of the designated column in the current row
of as an |
protected java.sql.ResultSet
|
getResultSet()
Gets the current result set. |
java.lang.Object
|
invokeMethod(java.lang.String name, java.lang.Object args)
|
boolean
|
next()
Moves the cursor down one row from its current position. |
protected int
|
normalizeIndex(int index)
Takes a zero based index and convert it into an SQL based 1 based index. |
boolean
|
previous()
Moves the cursor to the previous row in this
|
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 columnName, java.lang.Object newValue)
Updates the designated column with an |
java.lang.String
|
toString()
|
Methods inherited from class GroovyObjectSupport | |
---|---|
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructor Detail |
---|
public GroovyResultSetExtension(java.sql.ResultSet set)
set
- the result set
Method Detail |
---|
public void add(java.util.Map values)
values
- a map containing the mappings for column names and values
public void eachRow(Closure closure)
closure
- the closure to perform on each row
public java.lang.Object getAt(int index)
index
- is the number of the column to look at starting at 1
public java.lang.Object getProperty(java.lang.String columnName)
Object
.columnName
- the SQL name of the column
protected java.sql.ResultSet getResultSet()
public java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args)
public boolean next()
getResultSet()
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 getResultSet()
object's
warning chain is cleared when a new row is read.
true
if the new current row is valid;
false
if there are no more rows
protected int normalizeIndex(int index)
index
- the raw requested index (may be negative)
public boolean previous()
getResultSet()
object.TYPE_FORWARD_ONLY
true
if the cursor is on a valid row;
false
if it is off the result set
public void putAt(int index, java.lang.Object newValue)
index
- is the number of the column to look at starting at 1newValue
- the updated value
public void setProperty(java.lang.String columnName, java.lang.Object newValue)
Object
value.columnName
- the SQL name of the columnnewValue
- the updated value
public java.lang.String toString()
Groovy Documentation