Java Platform 1.2
Beta 4

Interface java.sql.Array


public abstract interface 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. By default, an Array is implemented using an SQL LOCATOR(array) internally.


Method Summary
 Object getArray()
          Retrieve the contents of the SQL array designated by the object.
 Object getArray(long index, int count, Map 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.
 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.
 Object getArray(Map map)
          Retrieve the contents of the SQL array designated by this object.
 int getBaseType()
          Determine the code, from java.sql.
 String getBaseTypeName()
          Return the fully qualified SQL type name of the elements of this array.
 ResultSet getResultSet()
          Materialize the item designated by the Array as a ResultSet that contains a row for each element of the 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(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(Map map)
          Materialize the item designated by the Array as a ResultSet that contains a row for each element of the Array.
 

Method Detail

getBaseTypeName

public String getBaseTypeName()
                       throws SQLException
Return the fully qualified SQL type name of the elements of this array.

getBaseType

public int getBaseType()
                throws SQLException
Determine the code, from java.sql.Types, of the type of the elements of the array.
Returns:
the type code of the elements of the array.

getArray

public Object getArray()
                throws 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.
Returns:
a Java array containing the ordered elements of the SQL array designated by this object.

getArray

public Object getArray(Map map)
                throws 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.
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.

getArray

public Object getArray(long index,
                       int count)
                throws 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.
Returns:
an array containing up to @count elements of the SQL array, beginning with element @index.

getArray

public Object getArray(long index,
                       int count,
                       Map map)
                throws 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.
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.

getResultSet

public ResultSet getResultSet()
                       throws 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.
Returns:
a result set containing the elements of the array

getResultSet

public ResultSet getResultSet(Map map)
                       throws 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.
Parameters:
map - contains mapping of SQL user-defined types to classes
Returns:
a result set containing the elements of the array

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.
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

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.
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

Java Platform 1.2
Beta 4

Submit a bug or feature
Submit comments/suggestions about new javadoc look
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.
This documentation was generated with a post-Beta4 version of Javadoc.