Hitachi

Hitachi Advanced Database Application Development Guide


8.1.7 getResultSet(long index, int count)

Organization of this subsection

(1) Function

This method acquires a result set containing a portion of array elements of an array-type column.

(2) Format

public synchronized ResultSet getResultSet(long index,int count) throws SQLException

(3) Arguments

long index

Specifies the ordinal number of the first array element to retrieve. Specify 1 to retrieve from the beginning of the array.

int count

Specifies the number of array elements to be retrieved consecutively.

(4) Return value

A sequence of array elements, starting from the ordinal number specified in the argument index and up to the number specified in the argument count, is returned as a ResultSet object.

The relationship between the values specified for the arguments index and count and the ResultSet object returned is shown in the following table.

Table 8‒5: Values specified in the arguments and the ResultSet object returned

Specified value of index

Specified value of count

Specified value of index + specified value of count

ResultSet object returned

1 ≤ specified-index-valuenumber-of-array-elements

0 ≤ specified-count-value

(specified-index-value + specified-count-value) - 1 ≤ number-of-array-elements

A result set with a length equal to the specified count value

(specified-index-value + specified-count-value) - 1 > number-of-array-elements

A result set with a length equal to the number-of-array-elements - (specified-index-value - 1)

specified-count-value < 0

--

Throwing an SQLException

specified-index-value > number-of-array-elements

--

--

Throwing an SQLException

specified-index-value < 1

--

--

Throwing an SQLException

Legend:

--: Not applicable.

(5) Exceptions

The JDBC driver throws an SQLException in the following cases: