1.50.39

interbase.interclient
Class Array

java.lang.Object
  |
  +--interbase.interclient.Array

public final class Array
extends Object
implements Array

Represents an SQL 3 Array. By default, an Array is a transaction duration reference to an SQL array. By default, an Array is implemented using an SQL LOCATOR(array) internally.

Since:
JDBC 2, not yet supported

Method Summary
 Object getArray()
          Retrieve the contents of this SQL array as a Java array object.
 Object getArray(long index, int count)
          Gets a Java array object containing a slice of this SQL array.
 Object getArray(long index, int count, Map map)
          Gets a Java array object containing a slice of this SQL array using a type-map customization.
 Object getArray(Map map)
          Retrieve the contents of this SQL array as a Java array object using type-map customization.
 int getBaseType()
          Determine the SQL type of the elements of the array.
 String getBaseTypeName()
          Return the fully qualified SQL type name of the elements of this array.
 ResultSet getResultSet()
          Materialize the items designated by this Array as a ResultSet that contains a row for each element of the Array.
 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.
 ResultSet getResultSet(long index, int count, Map map)
          Materialize the designated sub-array as a ResultSet that contains a row for each element of the sub-array.
 ResultSet getResultSet(Map map)
          Materialize the items designated by this 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 String getBaseTypeName()
                       throws SQLException
Return the fully qualified SQL type name of the elements of this array.
Specified by:
getBaseTypeName in interface Array
Throws:
SQLException - if a database access error occurs.
Since:
JDBC 2, not yet supported

getBaseType

public int getBaseType()
                throws SQLException
Determine the SQL type of the elements of the array.
Specified by:
getBaseType in interface Array
Returns:
a type code of the elements of the array from java.sql.Types
Throws:
SQLException - if a database access error occurs.
Since:
JDBC 2, not yet supported

getArray

public Object getArray()
                throws SQLException
Retrieve the contents of this SQL array as a Java array 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 Array
Returns:
a Java array containing the ordered elements of the SQL array designated by this object.
Throws:
SQLException - if a database access error occurs.
Since:
JDBC 2, not yet supported

getArray

public Object getArray(Map map)
                throws SQLException
Retrieve the contents of this SQL array as a Java array object using type-map customization. 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 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:
SQLException - if a database access error occurs.
Since:
JDBC 2, not yet supported

getArray

public Object getArray(long index,
                       int count)
                throws SQLException
Gets a Java array object containing a slice of this SQL array. The array slice begins at the given index and contains 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 Array
Parameters:
index - the array-index of the first element to retrieve
count - the number of successive SQL array elements to retrieve
Returns:
an array containing up to count elements of the SQL array, beginning with element index.
Throws:
SQLException - if a database access error occurs.
Since:
JDBC 2, not yet supported

getArray

public Object getArray(long index,
                       int count,
                       Map map)
                throws SQLException
Gets a Java array object containing a slice of this SQL array using a type-map customization. The array slice begins at the given index and contains up to count successive elements of the SQL array. Use the given map for type-map customizations.
Specified by:
getArray in interface Array
Parameters:
index - the array-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:
an array containing up to count elements of the SQL array, beginning with element index.
Throws:
SQLException - if a database access error occurs.
Since:
JDBC 2, not yet supported

getResultSet

public ResultSet getResultSet()
                       throws SQLException
Materialize the items designated by this 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 Array
Returns:
a result set containing the elements of the array
Throws:
SQLException - if a database access error occurs.
Since:
JDBC 2, not yet supported

getResultSet

public ResultSet getResultSet(Map map)
                       throws SQLException
Materialize the items designated by this 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 mapfor type-map customizations.
Specified by:
getResultSet in interface Array
Parameters:
map - contains mapping of SQL user-defined types to classes
Returns:
a result set containing the elements of the array
Throws:
SQLException - if a database access error occurs.
Since:
JDBC 2, not yet supported

getResultSet

public ResultSet getResultSet(long index,
                              int count)
                       throws 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 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:
SQLException - if a database access error occurs.
Since:
JDBC 2, not yet supported

getResultSet

public ResultSet getResultSet(long index,
                              int count,
                              Map map)
                       throws 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 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:
SQLException - if a database access error occurs.
Since:
JDBC 2, not yet supported

1.50.39

Send comments or suggestions to icsupport@interbase.com