Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Constructor and description |
---|
GroovyResultSetExtension
(ResultSet set) Creates a GroovyResultSet implementation. |
Type | Name and description |
---|---|
void |
add(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. |
Object |
getAt(int index) Supports integer based subscript operators for accessing at numbered columns starting at zero. |
Object |
getProperty(String columnName) Gets the value of the designated column in the current row of as an Object . |
protected ResultSet |
getResultSet() Gets the current result set. |
Object |
invokeMethod(String name, 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 getResultSet() object. |
void |
putAt(int index, Object newValue) Supports integer based subscript operators for updating the values of numbered columns starting at zero. |
void |
setProperty(String columnName, Object newValue) Updates the designated column with an Object value. |
String |
toString() |
Methods inherited from class | Name |
---|---|
class GroovyObjectSupport |
getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Creates a GroovyResultSet implementation.
set
- the result setAdds a new row to the result set
values
- a map containing the mappings for column names and valuesCall the closure once for each row in the result set.
closure
- the closure to perform on each rowSupports integer based subscript operators for accessing at numbered columns starting at zero. Negative indices are supported, they will count from the last column backwards.
index
- is the number of the column to look at starting at 1 Gets the value of the designated column in the current row
of as an Object
.
columnName
- the SQL name of the columnGets the current result set.
Moves the cursor down one row from its current position.
A 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 rowsTakes a zero based index and convert it into an SQL based 1 based index. A negative index will count backwards from the last column.
index
- the raw requested index (may be negative) Moves the cursor to the previous row in this
getResultSet()
object.
TYPE_FORWARD_ONLY
true
if the cursor is on a valid row;
false
if it is off the result setSupports 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.
index
- is the number of the column to look at starting at 1newValue
- the updated value Updates the designated column with an Object
value.
columnName
- the SQL name of the columnnewValue
- the updated valueCopyright © 2003-2015 The Apache Software Foundation. All rights reserved.