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:
java.sql.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.
All methods on the Array interface must be fully implemented if the
JDBC driver supports the data type.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Type | |
| pack-priv Object[] | |
| pack-priv Type |
| Access | Constructor and Description |
|---|---|
| public | JDBCArrayBasic(Object[]
the Object[] data, Type the HSQLDB org.hsqldb.types.Type object type)Public constructor to create an Array object from an Object[] and an HSQLDB org.hsqldb.types.Type object. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | free()
Implements java. This method frees the |
| public Object | Returns: an array in the Java programming language that contains the ordered elements of the SQLARRAY value
designated by this Array objectImplements java. Retrieves 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 languageImplements java. Retrieves 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)Implements java. 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 mappedImplements java. Retrieves a slice of the SQL |
| pack-priv Object[] | |
| public int | Returns: a constant from the classjava. that is
the type code for the elements in the array designated by this
Array objectImplements java. Retrieves 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 UDTImplements java. Retrieves 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.Implements java. 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)Implements java. 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)Implements java. 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 languageImplements java. Retrieves a result set holding the elements of the subarray that
starts at index |
| private Result | |
| public String | toString()
Overrides java. Returns a string representation in the form |
| arrayType | back to summary |
|---|---|
| pack-priv Type arrayType | |
| data | back to summary |
|---|---|
| pack-priv Object[] data | |
| elementType | back to summary |
|---|---|
| pack-priv Type elementType | |
| JDBCArrayBasic | back to summary |
|---|---|
| public JDBCArrayBasic(Object[] data, Type type) Public constructor to create an Array object from an Object[] and an HSQLDB org.hsqldb.types.Type object. | |
| checkClosed | back to summary |
|---|---|
| private void checkClosed() throws SQLException | |
| free | back to summary |
|---|---|
| public void free() throws SQLException Implements java. This method frees the
After
| |
| getArray | back to summary |
|---|---|
| public Object getArray() Implements java. Retrieves the contents of the SQL Note When HSQLDB-Specific Information: HSQLDB always returns an array ofObject.
| |
| getArray | back to summary |
|---|---|
| public Object getArray(Map<String, Class<?>> map) throws SQLException Implements java. Retrieves the contents of the SQL Note When HSQLDB-Specific Information: HSQLDB always returns an array ofObject.
| |
| getArray | back to summary |
|---|---|
| public Object getArray(long index, int count) throws SQLException Implements java. Retrieves a slice of the SQL Note When HSQLDB-Specific Information: HSQLDB always returns an array ofObject.
| |
| getArray | back to summary |
|---|---|
| public Object getArray(long index, int count, Map<String, Class<?>> map) throws SQLException Implements java. Retrieves a slice of the SQL
This method uses
the specified Note When HSQLDB-Specific Information: HSQLDB always returns an array ofObject.
| |
| getArrayInternal | back to summary |
|---|---|
| pack-priv Object[] getArrayInternal() | |
| getBaseType | back to summary |
|---|---|
| public int getBaseType() throws SQLException Implements java. Retrieves the JDBC type of the elements in the array designated
by this
| |
| getBaseTypeName | back to summary |
|---|---|
| public String getBaseTypeName() throws SQLException Implements java. Retrieves the SQL type name of the elements in
the array designated by this
| |
| getResultSet | back to summary |
|---|---|
| public ResultSet getResultSet() throws SQLException Implements java. 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 Implements java. 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 Implements java. 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 Implements java. 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
| |
| newColumnResult | back to summary |
|---|---|
| private Result newColumnResult(long position, int count) throws SQLException | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation in the form | |