com.informix.jdbc

## Class IfxArray

- java.lang.Object
- - com.informix.jdbc.IfxArray

All Implemented Interfaces:
  java.sql.Array

    public class IfxArray
    extends java.lang.Object
    implements java.sql.Array

JDBC 2.0

SQL arrays are mapped to the Array interface. By default, an Array is a transaction duration reference to an SQL array.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `free()`
`java.lang.Object` `getArray()` Retrieve the contents of the SQL array designated by the object.
`java.lang.Object` `getArray(long index, int count)` Like getArray() above, but returns an array containing a slice of the SQL array, beginning with the given @index and containing up to @count successive elements of the SQL array.
`java.lang.Object` `getArray(long index, int count, java.util.Map<java.lang.String,java.lang.Class<?>> map)` Like getArray() above, but returns an array containing a slice of the SQL array, beginning with the given @index and containing up to @count successive elements of the SQL array.
`java.lang.Object` `getArray(java.util.Map<java.lang.String,java.lang.Class<?>> map)` Retrieve the contents of the SQL array designated by this object.
`int` `getBaseType()` Determine the code, from java.sql.Types, of the type of the elements of the array.
`java.lang.String` `getBaseTypeName()` Return the fully qualified SQL (Informix) name of the elements of this array.
`java.sql.ResultSet` `getResultSet()` Materialize the item designated by the Array as a ResultSet that contains a row for each element of the Array.
`java.sql.ResultSet` `getResultSet(long index, int count)` Materialize the designated sub-array as a ResultSet that contains a row for each element of the sub-array.
`java.sql.ResultSet` `getResultSet(long index, int count, java.util.Map<java.lang.String,java.lang.Class<?>> map)` Materialize the designated sub-array as a ResultSet that contains a row for each element of the sub-array.
`java.sql.ResultSet` `getResultSet(java.util.Map<java.lang.String,java.lang.Class<?>> map)` Materialize the item designated by the Array as a ResultSet that contains a row for each element of the Array.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### getBaseTypeName

    public java.lang.String getBaseTypeName()
                                     throws java.sql.SQLException

Return the fully qualified SQL (Informix) name of the elements of this array. e.g., this is an array of integers return "INT". If array elements are UDT's then return fully qualified SQL type name.

Specified by:
  `getBaseTypeName` in interface `java.sql.Array`
Throws:
  `java.sql.SQLException`

#### getBaseType

    public int getBaseType()
                    throws java.sql.SQLException

Determine the code, from java.sql.Types, of the type of the elements of the array.

Specified by:
  `getBaseType` in interface `java.sql.Array`
Returns:
  the type code of the elements of the array.
Throws:
  `java.sql.SQLException`

#### getArray

    public java.lang.Object getArray()
                              throws java.sql.SQLException

Retrieve the contents of the SQL array designated by the object. Use the type-map associated with the connection for customizations of the type-mappings. Conceptually, this method calls getObject() on each element of the array and returns a Java array containing the result. Except when the array element type maps to a Java primitive type, such as int, boolean, etc. In this case, an array of primitive type values, i.e. an array of int, is returned, not an array of Integer. This exception for primitive types should improve performance as well as usability.

Specified by:
  `getArray` in interface `java.sql.Array`
Returns:
  a Java array containing the ordered elements of the SQL array designated by this object.
Throws:
  `java.sql.SQLException`

#### getArray

    public java.lang.Object getArray(java.util.Map<java.lang.String,java.lang.Class<?>> map)
                              throws java.sql.SQLException

Retrieve the contents of the SQL array designated by this object. Use the given @map for type-map customizations. Conceptually, this method calls getObject() on each element of the array and returns a Java array containing the result. Except when the array element type maps to a Java primitive type, such as int, boolean, etc. In this case, an array of primitive type values, i.e. an array of int, is returned, not an array of Integer. This exception for primitive types should improve performance as well as usability.

Specified by:
  `getArray` in interface `java.sql.Array`
Parameters:
  `map` - contains mapping of SQL type names to Java classes
Returns:
  a Java array containing the ordered elements of the SQL array designated by this object.
Throws:
  `java.sql.SQLException`

#### getArray

    public java.lang.Object getArray(long index,
                                     int count)
                              throws java.sql.SQLException

Like getArray() above, but returns an array containing a slice of the SQL array, beginning with the given @index and containing up to @count successive elements of the SQL array. Use the type-map associated with the connection for customizations of the type-mappings.

Specified by:
  `getArray` in interface `java.sql.Array`
Returns:
  an array containing up to @count elements of the SQL array, beginning with element @index.
Throws:
  `java.sql.SQLException`

#### getArray

    public java.lang.Object getArray(long index,
                                     int count,
                                     java.util.Map<java.lang.String,java.lang.Class<?>> map)
                              throws java.sql.SQLException

Like getArray() above, but returns an array containing a slice of the SQL array, beginning with the given @index and containing up to @count successive elements of the SQL array. Use the given @map for type-map customizations.

Specified by:
  `getArray` in interface `java.sql.Array`
Parameters:
  `map` - contains mapping of SQL user-defined types to classes
Returns:
  an array containing up to @count elements of the SQL array, beginning with element @index.
Throws:
  `java.sql.SQLException`

#### getResultSet

    public java.sql.ResultSet getResultSet()
                                    throws java.sql.SQLException

Materialize the item designated by the Array as a ResultSet that contains a row for each element of the Array. The first column of each row contains the array index of the corresponding element in the Array. The second column contains the array element value. The rows are ordered in ascending order of the array-element indexes.

Specified by:
  `getResultSet` in interface `java.sql.Array`
Returns:
  a result set containing the elements of the array
Throws:
  `java.sql.SQLException`

#### getResultSet

    public java.sql.ResultSet getResultSet(java.util.Map<java.lang.String,java.lang.Class<?>> map)
                                    throws java.sql.SQLException

Materialize the item designated by the Array as a ResultSet that contains a row for each element of the Array. The first column of each row contains the array index of the corresponding element in the Array. The second column contains the array element value. The rows are ordered in ascending order of the array-element indexes. Use the given @map for type-map customizations.

Specified by:
  `getResultSet` in interface `java.sql.Array`
Parameters:
  `map` - contains mapping of SQL user-defined types to classes
Returns:
  a result set containing the elements of the array
Throws:
  `java.sql.SQLException`

#### getResultSet

    public java.sql.ResultSet getResultSet(long index,
                                           int count)
                                    throws java.sql.SQLException

Materialize the designated sub-array as a ResultSet that contains a row for each element of the sub-array. The first column of each row contains the array index of the corresponding element in the Array. The second column contains the array element value. The rows are ordered in ascending order of the array-element indexes.

Specified by:
  `getResultSet` in interface `java.sql.Array`
Parameters:
  `index` - the index of the first element to retrieve
  `count` - the number of successive SQL array elements to retrieve
Returns:
  a result set containing the elements of the array
Throws:
  `java.sql.SQLException`

#### getResultSet

    public java.sql.ResultSet getResultSet(long index,
                                           int count,
                                           java.util.Map<java.lang.String,java.lang.Class<?>> map)
                                    throws java.sql.SQLException

Materialize the designated sub-array as a ResultSet that contains a row for each element of the sub-array. The first column of each row contains the array index of the corresponding element in the Array. The second column contains the array element value. The rows are ordered in ascending order of the array-element indexes. Use the given @map for type-map customizations.

Specified by:
  `getResultSet` in interface `java.sql.Array`
Parameters:
  `index` - the index of the first element to retrieve
  `count` - the number of successive SQL array elements to retrieve
  `map` - contains mapping of SQL user-defined types to classes
Returns:
  a result set containing the elements of the array
Throws:
  `java.sql.SQLException`

#### free

    public void free()
              throws java.sql.SQLException

Specified by:
  `free` in interface `java.sql.Array`
Throws:
  `java.sql.SQLException`