ARRAY.
By default, an Array value is a transaction-duration
reference to an SQL ARRAY value. By default, an Array
object is implemented using an SQL LOCATOR(array) internally, which
means that an Array object contains a logical pointer
to the data in the SQL ARRAY value rather
than containing the ARRAY value's data.
The Array interface provides methods for bringing an SQL
ARRAY value's data to the client as either an array or a
ResultSet object.
If the elements of the SQL ARRAY
are a UDT, they may be custom mapped. To create a custom mapping,
a programmer must do two things:
SQLData
interface for the UDT to be custom mapped.
Class object for the class implementing
SQLData
When a type map with an entry for
the base type is supplied to the methods getArray
and getResultSet, the mapping
it contains will be used to map the elements of the ARRAY value.
If no type map is supplied, which would typically be the case,
the connection's type map is used by default.
If the connection's type map or a type map supplied to a method has no entry
for the base type, the elements are mapped according to the standard mapping.
To release resources used by the Array object, applications must call
either the free() or the close() method. Any attempt to
invoke a method other than free() or close() after the
Array object has been closed, will result in a SQLException
being thrown.
All methods on the Array interface must be fully implemented if the
JDBC driver supports the data type.
| Modifier and Type | Method and Description |
|---|---|
| public default void | close()
Implements java. Closes and releases the resources held by this |
| public void | |
| public Object | Returns: an array in the Java programming language that contains the ordered elements of the SQLARRAY value
designated by this Array objectRetrieves the contents of the SQL |
| public Object | Returns: an array in the Java programming language that contains the ordered elements of the SQL array designated by this objecta map)java.util.Map object that contains mappings
of SQL type names to classes in the Java programming languageRetrieves the contents of the SQL |
| public Object | Returns: an array containing up tocount consecutive elements
of the SQL array, beginning with element indexthe array index of the first element to retrieve;
the first element is at index 1 index, int the number of successive SQL array elements to retrieve count)Retrieves a slice of the SQL |
| public Object | Returns: an array containing up tocount
consecutive elements of the SQL ARRAY value designated by this
Array object, beginning with element
indexthe array index of the first element to retrieve;
the first element is at index 1 index, int the number of successive SQL array elements to
retrieve count, Map<String, Class<?>> a map)java.util.Map object
that contains SQL type names and the classes in
the Java programming language to which they are mappedRetrieves a slice of the SQL |
| public int | Returns: a constant from the classjava. that is
the type code for the elements in the array designated by this
Array objectRetrieves the JDBC type of the elements in the array designated
by this |
| public String | Returns: aString that is the database-specific
name for a built-in base type; or the fully-qualified SQL type
name for a base type that is a UDTRetrieves the SQL type name of the elements in
the array designated by this |
| public ResultSet | Returns: aResultSet object containing one row for each
of the elements in the array designated by this Array
object, with the rows in ascending order based on the indices.Retrieves a result set that contains the elements of the SQL
|
| public ResultSet | Returns: aResultSet object containing one row for each
of the elements in the array designated by this Array
object, with the rows in ascending order based on the indices.contains the mapping of SQL user-defined types to
classes in the Java programming language map)Retrieves a result set that contains the elements of the SQL
|
| public ResultSet | Returns: aResultSet object containing up to
count consecutive elements of the SQL array
designated by this Array object, starting at
index index.the array index of the first element to retrieve;
the first element is at index 1 index, int the number of successive SQL array elements to retrieve count)Retrieves a result set holding the elements of the subarray that
starts at index |
| public ResultSet | Returns: aResultSet object containing up to
count consecutive elements of the SQL array
designated by this Array object, starting at
index index.the array index of the first element to retrieve;
the first element is at index 1 index, int the number of successive SQL array elements to retrieve count, Map<String, Class<?>> the map)Map object that contains the mapping
of SQL type names to classes in the Java(tm) programming languageRetrieves a result set holding the elements of the subarray that
starts at index |
| close | back to summary |
|---|---|
| public default void close() throws SQLException Implements java. Closes and releases the resources held by this
If the Implementation Specification The default implementation calls the
| |
| free | back to summary |
|---|---|
| public void free() throws SQLException Closes and releases the resources held by this
If the
| |
| getArray | back to summary |
|---|---|
| public Object getArray() throws SQLException Retrieves the contents of the SQL Note When
| |
| getArray | back to summary |
|---|---|
| public Object getArray(Map<String, Class<?>> map) throws SQLException Retrieves the contents of the SQL Note When
| |
| getArray | back to summary |
|---|---|
| public Object getArray(long index, int count) throws SQLException Retrieves a slice of the SQL Note When
| |
| getArray | back to summary |
|---|---|
| public Object getArray(long index, int count, Map<String, Class<?>> map) throws SQLException Retrieves a slice of the SQL
This method uses
the specified Note When
| |
| getBaseType | back to summary |
|---|---|
| public int getBaseType() throws SQLException Retrieves the JDBC type of the elements in the array designated
by this
| |
| getBaseTypeName | back to summary |
|---|---|
| public String getBaseTypeName() throws SQLException Retrieves the SQL type name of the elements in
the array designated by this
| |
| getResultSet | back to summary |
|---|---|
| public ResultSet getResultSet() throws SQLException Retrieves a result set that contains the elements of the SQL
The result set contains one row for each array element, with two columns in each row. The second column stores the element value; the first column stores the index into the array for that element (with the first array element being at index 1). The rows are in ascending order corresponding to the order of the indices.
| |
| getResultSet | back to summary |
|---|---|
| public ResultSet getResultSet(Map<String, Class<?>> map) throws SQLException Retrieves a result set that contains the elements of the SQL
The result set contains one row for each array element, with two columns in each row. The second column stores the element value; the first column stores the index into the array for that element (with the first array element being at index 1). The rows are in ascending order corresponding to the order of the indices.
| |
| getResultSet | back to summary |
|---|---|
| public ResultSet getResultSet(long index, int count) throws SQLException Retrieves a result set holding the elements of the subarray that
starts at index
The result set has one row for each element of the SQL array
designated by this object, with the first row containing the
element at index
| |
| getResultSet | back to summary |
|---|---|
| public ResultSet getResultSet(long index, int count, Map<String, Class<?>> map) throws SQLException Retrieves a result set holding the elements of the subarray that
starts at index
The result set has one row for each element of the SQL array
designated by this object, with the first row containing the
element at index
| |