Hitachi

Hitachi Advanced Database Application Development Guide


8.1.3 getArray(long index, int count)

Organization of this subsection

(1) Function

This method acquires a portion of array elements of an array-type column as an Object array.

(2) Format

public synchronized Object getArray(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

Among the array elements stored in the Array object, a maximum of the number of consecutive array elements specified in the argument count, starting from the sequence number specified in the argument index, is returned as an Object array.

For the data type of the returned array element in HADB, refer to Table 8‒2: HADB data types of returned array elements.

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

Table 8‒3: Values specified in argument and returned array

Specified value of index

Specified value of count

Specified value of index + specified value of count

Returned array

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

0 ≤ specified-count-value

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

An array with a length equal to the specified-count-value

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

An array 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: