8.1.2 getArray()
- Organization of this subsection
(1) Function
This method acquires all array elements of an array-type column as an Object array.
(2) Format
public synchronized Object getArray() throws SQLException
(3) Arguments
None.
(4) Return value
This method returns an Object array containing all array elements of the array type held within this Array object.
The following table lists the HADB data types of the returned array elements.
|
HADB data type of array element (element data type) |
Returned array |
|---|---|
|
BIGINT |
java.lang.Long[] |
|
INTEGER#1 |
java.lang.Integer[] |
|
SMALLINT#2 |
java.lang.Short[] |
|
DECIMAL or NUMERIC |
java.math.BigDecimal[] |
|
DOUBLE PRECISION or FLOAT |
java.lang.Double[] |
|
REAL |
java.lang.Float[] |
|
CHAR |
java.lang.String[] |
|
VARCHAR |
java.lang.String[] |
|
STRING |
java.lang.String[] |
|
DATE |
java.sql.Date[] |
|
TIME |
java.sql.Time[] |
|
TIMESTAMP WITHOUT TIME ZONE |
java.sql.Timestamp[] |
|
TIMESTAMP WITH TIME ZONE |
java.time.OffsetDateTime[] |
|
BINARY |
java.io.InputStream[] |
|
VARBINARY |
java.io.InputStream[] |
|
BOOLEAN |
java.lang.Boolean[] |
|
UUID |
java.io.InputStream[] |
- #1
-
If the integer data type format is in legacy format, java.lang.Long[] is returned.
- #2
-
If the integer data type format is in legacy format, java.lang.Integer[] is returned.
(5) Exceptions
The JDBC driver throws an SQLException in the following cases:
-
The ResultSet object that created this Array object is closed.
This scenario also includes cases where the ResultSet object was closed because the Statement object that created this ResultSet object was closed.
-
The Connection object used to create the Statement object has been closed.
-
The ResultSet object has become invalid due to transaction settlement.
-
The column value cannot be retrieved as an Array value.
-
An error occurred in the JDBC driver.