public interface DBArrayElementSet
A DBArrayElementSet
object maintains a cursor pointing
to its current row of data. Initially the cursor is positioned
before the first row. The next
method moves the
cursor to the next row, and because it returns false
when there are no more rows in the ElementSet
object,
it can be used in a while
loop to iterate through
the element set.
The DBArrayElementSet
interface provides
getter methods (getBoolean
, getLong
, and so on)
for retrieving field values from the current element.
Values can be retrieved using either the index number of the
field or the name of the field. In general, using the
field index will be more efficient. Fields are numbered from 1.
For maximum portability, result set fields within each row should be
read in left-to-right order, and each field should be read only once.
For the getter methods, a JDBC driver attempts
to convert the underlying data to the Java type specified in the
getter method and returns a suitable Java value. The JDBC specification
has a table showing the allowable mappings from SQL types to Java types
that can be used by the ResultSet
getter methods.
Modifier and Type | Method and Description |
---|---|
boolean |
absolute(int element)
Moves to the specified element in the array.
|
void |
addElement()
Adds the current element to the element set.
|
void |
beforeFirst()
Positions the cursor to before the first element.
|
boolean |
first()
Moves to the first element in the array.
|
DBArray |
getArray(java.lang.String fieldName)
Retrieves the value of the designated field in the current element of the
DBArrayElementSet object as a
com.ibm.ims.dli.DBArray . |
java.math.BigDecimal |
getBigDecimal(java.lang.String fieldName)
Retrieves the value of the designated field in the
DBArrayElementSet object as a
. |
boolean |
getBoolean(java.lang.String fieldName)
Retrieves the value of the designated field in the
DBArrayElementSet object as a boolean . |
byte |
getByte(java.lang.String fieldName)
Retrieves the value of the designated field in the segment of this
DBArrayElementSet object as a byte . |
byte[] |
getBytes(java.lang.String fieldName)
Gets the value of the designated field in the
DBArrayElementSet object as a byte array. |
int |
getCurrentElementIndex()
Returns the current position in the element set
|
java.sql.Date |
getDate(java.lang.String fieldName)
Sets the value of the designated field in the
DBArrayElementSet object as a java.sql.Date . |
double |
getDouble(java.lang.String fieldName)
Retrieves the value of the designated field in the
DBArrayElementSet object as a double . |
float |
getFloat(java.lang.String fieldName)
Retrieves the value of the designated field in the
DBArrayElementSet object as a float . |
int |
getInt(java.lang.String fieldName)
Retrieves the value of the designated field in the segment of this
DBArrayElementSet object as an int . |
long |
getLong(java.lang.String fieldName)
Retrieves the value of the designated field in the
DBArrayElementSet object as a long . |
DBArrayElementSetMetaData |
getMetaData()
This method will return the metadata of an array field represented by its DBArrayElementSet.
|
java.lang.Object |
getObject(java.lang.String fieldName)
Retrieves the value of the designated field in the
DBArrayElementSet object as an Object in the
Java Programming Language. |
short |
getShort(java.lang.String fieldName)
Retrieves the value of the designated field in the
DBArrayElementSet object as a short . |
java.lang.String |
getString(java.lang.String fieldName)
Gets the value of the designated field in the
DBArrayElementSet object as a java.lang.String . |
java.sql.Time |
getTime(java.lang.String fieldName)
Sets the value of the designated field in the
DBArrayElementSet object as a java.sql.Time . |
java.sql.Timestamp |
getTimestamp(java.lang.String fieldName)
Sets the value of the designated field in the
DBArrayElementSet object as a
java.sql.TimeStamp . |
boolean |
isClosed()
Retrieves whether this
DBArrayElementSet object has been
closed. |
boolean |
last()
Moves to the last element in the array.
|
void |
moveToCurrentElement()
Calling this method will restore the remembered cursor position after
calling
DBArrayElementSet.prepareElementToAdd
This method can only be called if the DBArray object is dynamic. |
boolean |
next()
Moves to the next element in the array.
|
void |
prepareElementToAdd()
Moves the cursor to a new element that will be added to the element set after
calling
DBArrayElementSet.addElement . |
boolean |
previous()
Moves to the previous element in the array.
|
void |
removeElement()
Removes the current element.
|
void |
setArray(java.lang.String fieldName,
DBArray value)
Sets the value of the designated field in the
DBArrayElementSet object as a
com.ibm.ims.dli.DBArray . |
void |
setBigDecimal(java.lang.String fieldName,
java.math.BigDecimal value)
Sets the value of the field in the
DBArrayElementSet object
as a java.math.BigDecimal . |
void |
setBoolean(java.lang.String fieldName,
boolean value)
Sets the value of the designated field in the
DBArrayElementSet object as a boolean . |
void |
setByte(java.lang.String fieldName,
byte value)
Sets the value of the designated field in the segment of this
DBArrayElementSet object as a byte . |
void |
setBytes(java.lang.String fieldName,
byte[] value)
Sets the value of the designated field in the
DBArrayElementSet object as a byte array. |
void |
setDate(java.lang.String fieldName,
java.sql.Date value)
Sets the value of the designated field in the
DBArrayElementSet object as a java.sql.Date . |
void |
setDouble(java.lang.String fieldName,
double value)
Sets the value of the designated field in the
DBArrayElementSet object as a double . |
void |
setFloat(java.lang.String fieldName,
float value)
Sets the value of the designated field in the
DBArrayElementSet object as a float . |
void |
setInt(java.lang.String fieldName,
int value)
Sets the value of the designated field in the
DBArrayElementSet object as an int . |
void |
setLong(java.lang.String fieldName,
long value)
Sets the value of the designated field in the
DBArrayElementSet object as a long . |
void |
setObject(java.lang.String fieldName,
java.lang.Object value)
Sets the value of the designated field in the
DBArrayElementSet object with the Object value. |
void |
setShort(java.lang.String fieldName,
short value)
Sets the value of the designated field in the s
DBArrayElementSet object as a short . |
void |
setString(java.lang.String fieldName,
java.lang.String value)
Sets the value of the designated field in the
DBArrayElementSet object as a java.lang.String . |
void |
setTime(java.lang.String fieldName,
java.sql.Time value)
Sets the value of the designated field in the
DBArrayElementSet object as a java.sql.Time . |
void |
setTimestamp(java.lang.String fieldName,
java.sql.Timestamp value)
Sets the value of the designated field in the
DBArrayElementSet object as a
java.sql.TimeStamp . |
int |
size()
Returns the number of elements within the element set
|
boolean isClosed() throws DLIException
DBArrayElementSet
object has been
closed. A DBArrayElementSet
is closed if the method
close
has been called on it, or if it is automatically
closed.true
if this DBArrayElementSet
object
is closed; false if it is still openDLIException
- if an error occursboolean next() throws DLIException
DLIException
- if an error occursboolean previous() throws DLIException
DLIException
- if an error occursboolean absolute(int element) throws DLIException
DLIException
- if an error occursboolean first() throws DLIException
DLIException
- if an error occursboolean last() throws DLIException
DLIException
- if an error occursDBArray getArray(java.lang.String fieldName) throws DLIException
DBArrayElementSet
object as a
com.ibm.ims.dli.DBArray
.DLIException
- if an error occursDBArray
void setArray(java.lang.String fieldName, DBArray value) throws DLIException
DBArrayElementSet
object as a
com.ibm.ims.dli.DBArray
.fieldName
- name of the fieldvalue
- value of the fieldDLIException
- if an error occursDBArray
boolean getBoolean(java.lang.String fieldName) throws DLIException
DBArrayElementSet
object as a boolean
.DLIException
- if an error occursvoid setBoolean(java.lang.String fieldName, boolean value) throws DLIException
DBArrayElementSet
object as a boolean
.fieldName
- name of the fieldvalue
- value of the fieldDLIException
- if an error occursbyte getByte(java.lang.String fieldName) throws DLIException
DBArrayElementSet
object as a byte
.DLIException
- if an error occursvoid setByte(java.lang.String fieldName, byte value) throws DLIException
DBArrayElementSet
object as a byte
.fieldName
- name of the fieldvalue
- value of the fieldDLIException
- if an error occursint getInt(java.lang.String fieldName) throws DLIException
DBArrayElementSet
object as an int
.DLIException
- if an error occursvoid setInt(java.lang.String fieldName, int value) throws DLIException
DBArrayElementSet
object as an int
.fieldName
- name of the fieldvalue
- value of the fieldDLIException
- if an error occursshort getShort(java.lang.String fieldName) throws DLIException
DBArrayElementSet
object as a short
.DLIException
- if an error occursvoid setShort(java.lang.String fieldName, short value) throws DLIException
DBArrayElementSet
object as a short
.fieldName
- name of the fieldvalue
- value of the fieldDLIException
- if an error occurslong getLong(java.lang.String fieldName) throws DLIException
DBArrayElementSet
object as a long
.DLIException
- if an error occursvoid setLong(java.lang.String fieldName, long value) throws DLIException
DBArrayElementSet
object as a long
.fieldName
- name of the fieldvalue
- value of the fieldDLIException
- if an error occursfloat getFloat(java.lang.String fieldName) throws DLIException
DBArrayElementSet
object as a float
.DLIException
- if an error occursvoid setFloat(java.lang.String fieldName, float value) throws DLIException
DBArrayElementSet
object as a float
.fieldName
- name of the fieldvalue
- value of the fieldDLIException
- if an error occursdouble getDouble(java.lang.String fieldName) throws DLIException
DBArrayElementSet
object as a double
.DLIException
- if an error occursvoid setDouble(java.lang.String fieldName, double value) throws DLIException
DBArrayElementSet
object as a double
.fieldName
- name of the fieldvalue
- value of the fieldDLIException
- if an error occursbyte[] getBytes(java.lang.String fieldName) throws DLIException
DBArrayElementSet
object as a byte
array.DLIException
- if an error occursvoid setBytes(java.lang.String fieldName, byte[] value) throws DLIException
DBArrayElementSet
object as a byte
array.fieldName
- name of the fieldvalue
- value of the fieldDLIException
- if an error occursjava.lang.String getString(java.lang.String fieldName) throws DLIException
DBArrayElementSet
object as a java.lang.String
.DLIException
- if an error occursvoid setString(java.lang.String fieldName, java.lang.String value) throws DLIException
DBArrayElementSet
object as a java.lang.String
.fieldName
- name of the fieldvalue
- value of the fieldDLIException
- if an error occursjava.math.BigDecimal getBigDecimal(java.lang.String fieldName) throws DLIException
DBArrayElementSet
object as a
java.math.BigDecimal
.DLIException
- if an error occursvoid setBigDecimal(java.lang.String fieldName, java.math.BigDecimal value) throws DLIException
DBArrayElementSet
object
as a java.math.BigDecimal
.fieldName
- name of the fieldvalue
- value of the fieldDLIException
- if an error occursjava.sql.Date getDate(java.lang.String fieldName) throws DLIException
DBArrayElementSet
object as a java.sql.Date
.DLIException
- if an error occursvoid setDate(java.lang.String fieldName, java.sql.Date value) throws DLIException
DBArrayElementSet
object as a java.sql.Date
.fieldName
- name of the fieldvalue
- value of the fieldDLIException
- if an error occursjava.sql.Time getTime(java.lang.String fieldName) throws DLIException
DBArrayElementSet
object as a java.sql.Time
.DLIException
- if an error occursvoid setTime(java.lang.String fieldName, java.sql.Time value) throws DLIException
DBArrayElementSet
object as a java.sql.Time
.fieldName
- name of the fieldvalue
- value of the fieldDLIException
- if an error occursjava.sql.Timestamp getTimestamp(java.lang.String fieldName) throws DLIException
DBArrayElementSet
object as a
java.sql.TimeStamp
.DLIException
- if an error occursvoid setTimestamp(java.lang.String fieldName, java.sql.Timestamp value) throws DLIException
DBArrayElementSet
object as a
java.sql.TimeStamp
.fieldName
- name of the fieldvalue
- value of the fieldDLIException
- if an error occursjava.lang.Object getObject(java.lang.String fieldName) throws DLIException
DBArrayElementSet
object as an Object
in the
Java Programming Language. DLIException
- if an error occursvoid setObject(java.lang.String fieldName, java.lang.Object value) throws DLIException
DBArrayElementSet
object with the Object
value.fieldName
- name of the fieldvalue
- value of the fieldDLIException
- if an error occursvoid prepareElementToAdd() throws DLIException
DBArrayElementSet.addElement
. This method only needs to
be called once prior to calling multiple DBArrayElementSet.addElement
The current cursor position is remembered while the cursor is positioned on
the new element. Calling DBArrayElementSet.moveToCurrentElement
will restore the remembered cursor position.
This method can only be called if the DBArray object is dynamic.DLIException
void addElement() throws DLIException
DLIException
void removeElement() throws DLIException
DLIException
void moveToCurrentElement() throws DLIException
DBArrayElementSet.prepareElementToAdd
This method can only be called if the DBArray object is dynamic.DLIException
int getCurrentElementIndex()
DLIException
int size()
void beforeFirst() throws DLIException
DLIException
DBArrayElementSetMetaData getMetaData() throws DLIException
DLIException