Package java.sql
Interface Array
public interface Array
A Java representation of the SQL
ARRAY type.-
Method Summary
Modifier and Type Method Description voidfree()Frees any resources held by this array.ObjectgetArray()Retrieves the contents of the SQLARRAYvalue as a Java array object.ObjectgetArray(long index, int count)Returns part of the SQLARRAYassociated with this array, starting at a particularindexand comprising up tocountsuccessive elements of the SQL array.ObjectgetArray(long index, int count, Map<String,Class<?>> map)Returns part of the SQLARRAYassociated with this array, starting at a particularindexand comprising up tocountsuccessive elements of the SQL array.ObjectgetArray(Map<String,Class<?>> map)Returns the data from the underlying SQLARRAYas a Java array.intgetBaseType()Returns the JDBC type of the entries in this array's underlying SQL array.StringgetBaseTypeName()Returns the SQL type name of the entries in this array's underlying SQL array.ResultSetgetResultSet()Returns a ResultSet object which holds the entries of the SQLARRAYassociated with this array.ResultSetgetResultSet(long index, int count)Returns aResultSetobject that holds the entries of a subarray, beginning at a particular index and comprising up tocountsuccessive entries.ResultSetgetResultSet(long index, int count, Map<String,Class<?>> map)Returns aResultSetobject that holds the entries of a subarray, beginning at a particular index and comprising up tocountsuccessive entries.ResultSetgetResultSet(Map<String,Class<?>> map)Returns aResultSetobject which holds the entries of the SQLARRAYassociated with this array.
-
Method Details
-
getArray
Retrieves the contents of the SQLARRAYvalue as a Java array object.- Returns:
- A Java array containing the elements of this Array
- Throws:
SQLException- if there is a database error.
-
getArray
Returns part of the SQLARRAYassociated with this array, starting at a particularindexand comprising up tocountsuccessive elements of the SQL array.- Parameters:
index- the start position in the array where the values are retrieved.count- the number of elements to retrieve.- Returns:
- A Java array containing the desired set of elements from this Array
- Throws:
SQLException- if there is a database error.
-
getArray
Returns part of the SQLARRAYassociated with this array, starting at a particularindexand comprising up tocountsuccessive elements of the SQL array.- Parameters:
index- the start position in the array where the values are retrieved.count- the number of elements to retrieve.map- the map defining the correspondence between SQL type names and Java types.- Returns:
- A Java array containing the desired set of elements from this Array
- Throws:
SQLException- if there is a database error.
-
getArray
Returns the data from the underlying SQLARRAYas a Java array.- Parameters:
map- the map defining the correspondence between SQL type names and Java types.- Returns:
- A Java array containing the elements of this array
- Throws:
SQLException- if there is a database error.
-
getBaseType
Returns the JDBC type of the entries in this array's underlying SQL array.- Returns:
- An integer constant from the
java.sql.Typesclass - Throws:
SQLException- if there is a database error.
-
getBaseTypeName
Returns the SQL type name of the entries in this array's underlying SQL array.- Returns:
- The database specific name or a fully-qualified SQL type name.
- Throws:
SQLException- if there is a database error.
-
getResultSet
Returns a ResultSet object which holds the entries of the SQLARRAYassociated with this array.- Returns:
- the elements of the array as a
ResultSet. - Throws:
SQLException- if there is a database error.
-
getResultSet
Returns aResultSetobject that holds the entries of a subarray, beginning at a particular index and comprising up tocountsuccessive entries.- Parameters:
index- the start position in the array where the values are retrieved.count- the number of elements to retrieve.- Returns:
- the elements of the array as a
ResultSet. - Throws:
SQLException- if there is a database error.
-
getResultSet
Returns aResultSetobject that holds the entries of a subarray, beginning at a particular index and comprising up tocountsuccessive entries.- Parameters:
index- the start position in the array where the values are retrieved.count- the number of elements to retrieve.map- the map defining the correspondence between SQL type names and Java types.- Returns:
- the
ResultSetthe array's custom type values. if a database error has occurred. - Throws:
SQLException- if there is a database error.
-
getResultSet
Returns aResultSetobject which holds the entries of the SQLARRAYassociated with this array.- Parameters:
map- the map defining the correspondence between SQL type names and Java types.- Returns:
- the array as a
ResultSet. - Throws:
SQLException- if there is a database error.
-
free
Frees any resources held by this array. Afterfreeis called, calling method other thanfreewill throwSQLException(callingfreerepeatedly will do nothing).- Throws:
SQLException
-