|
2.50.5 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--interbase.interclient.Array
The Java mapping for an SQL 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.
InterClient Notes:
JDBC 2.0 array support is based on the SQL3 standard and
does not require support for multidimensional arrays (or array of arrays).
InterClient supports the array data type as specified by the JDBC 2 specification,
but in addition to this support InterClient provides for multi-dimensional arrays as
supported by InterBase.
InterBase, supports multi-dimensional arrays up to 16 dimensions.
Because of these differences InterClient provides extension methods
to allow a users to work with multi-dimensional arrays.
In accordance with the JDBC 2 specification,
Array instances are created using
ResultSet.getArray.
So, in accordance with JDBC 2, there is no public constructor for this class.
An InterBase array may be referenced by an Array instance
for the duration of the transaction in which it was created.
Although it is not good programming practice,
an Array could be used even after its transaction has finished,
but its associated InterBase array may be garbage collected without warning
at any point in time after its transaction completes.
So, you may still be able get a Java array within the transaction context
of the completed transaction that created it, even after the InterBase array has
been modified by another transaction, but you will get an error from the engine if
the InterBase array has been garbage collected.
Note: Because of a current InterBase limitation only the "8859_1" character encoding is supported for arrays of Strings.
For further information on InterClient's support of InterBase arrays see InterClient Array Support in the InterClient help directory.
| Method Summary | |
Object |
getArray()
Retrieve the contents of this SQL array as a Java Array object. |
Object |
getArray(int[][] sliceBounds)
Gets a sub-array described by sliceBounds of this SQL array. |
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 map for type-map customization. |
int |
getBaseType()
Returns the JDBC type of the elements in this array. |
String |
getBaseTypeName()
Returns the SQL type name of the elements in this array. |
ResultSet |
getResultSet()
Gets a result set that contains the elements of this array. |
ResultSet |
getResultSet(int[][] sliceBounds)
Gets a result set holding the elements of a sub-array, or slice, described by sliceBounds. |
ResultSet |
getResultSet(long index,
int count)
Gets a result set holding the elements of the subarray that starts at index index and contains up to
count successive elements. |
ResultSet |
getResultSet(long index,
int count,
Map map)
Returns a result set holding the elements of the subarray that starts at index index and contains up to
count successive elements. |
ResultSet |
getResultSet(Map map)
Gets a result set that contains the elements of this array using map to map the array elements. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public String getBaseTypeName()
throws SQLException
getBaseTypeName in interface ArraySQLException - if an error occurs while attempting to access the type name
public int getBaseType()
throws SQLException
getBaseType in interface ArraySQLException - if an error occurs while attempting to access the the base type
public Object getArray()
throws SQLException
Array object.
This version of the method getArray
uses 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.
getArray in interface ArraySQLException - if an error occurs while attempting to access the array
public Object getArray(Map map)
throws SQLException
map for type-map customization.
If the base type of the array does not
match a user-defined type in map, the standard
mapping is used instead.
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.
getArray in interface Arraymap - a java.util.Map object that contains mappings
of SQL type names to classes in the Java programming languageSQLException - if an error occurs while attempting to access the array
public Object getArray(long index,
int count)
throws SQLException
index and
contains up to count successive elements of the SQL array.
This method uses the type-map
associated with the connection for customizations of the type-mappings.getArray in interface Arrayindex - the array index of the first element to retrieve;
the first element is at index 1count - the number of successive SQL array elements to retrievecount consecutive elements
of the SQL array, beginning with element indexSQLException - if an error occurs while attempting to access the array
public Object getArray(long index,
int count,
Map map)
throws SQLException
index and
contains up to count successive elements of the SQL array.
This method uses
the specified map for type-map customizations
unless the base type of the array does not match a user-
defined type in map, in which case it
uses the standard mapping.getArray in interface Arrayindex - the array index of the first element to retrieve;
the first element is at index 1count - the number of successive SQL array elements to retrievemap - a java.util.Map object
that contains SQL type names and the classes in
the Java programming language to which they are mappedcount
consecutive elements of the SQL array designated by this
Array object, beginning with element index.SQLException - if an error occurs while attempting to access the array
public ResultSet getResultSet()
throws SQLException
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 in interface ArrayResultSet 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.SQLException - if an error occurs while attempting to access the array
public ResultSet getResultSet(Map map)
throws SQLException
map to map the array elements. If the base
type of the array does not match a user-defined type in
map, the standard mapping is used instead.
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 in interface Arraymap - contains mapping of SQL user-defined types to
classes in the Java(tm) programming languageResultSet 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.SQLException - if an error occurs while attempting to access the array
public ResultSet getResultSet(long index,
int count)
throws SQLException
index and contains up to
count successive elements. This method uses
the connection's type map to map the elements of the array if
the map contains an entry for the base type. Otherwise, the
standard mapping is used.
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 index. The result set has
up to count rows in ascending order based on the
indices. Each row has two columns: The second column stores
the element value; the first column stroes the index into the
array for that element.
getResultSet in interface Arrayindex - the array index of the first element to retrieve;
the first element is at index 1count - the number of successive SQL array elements to retrieveResultSet object containing up to
count consecutive elements of the SQL array
designated by this Array object, starting at
index index.SQLException - if an error occurs while attempting to access the array
public ResultSet getResultSet(long index,
int count,
Map map)
throws SQLException
index and contains up to
count successive elements. This method uses
the Map object map to map the elements
of the array unless the base type of the array does not match
a user-defined type in map, in which case it uses
the standard mapping.
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 index. The result set has
up to count rows in ascending order based on the
indices. Each row has two columns: The second column stores
the element value; the first column stroes the index into the
array for that element.
getResultSet in interface Arrayindex - the array index of the first element to retrieve;
the first element is at index 1count - the number of successive SQL array elements to retrievemap - the Map object that contains the mapping
of SQL type names to classes in the Java(tm) programming languageResultSet object containing up to
count consecutive elements of the SQL array
designated by this Array object, starting at
index index.SQLException - if an error occurs while attempting to access the array
public Object getArray(int[][] sliceBounds)
throws SQLException
sliceBounds of this SQL array.
The slice is specified by a two-dimensional array sliceBounds.
The number of rows in this array must be equal to the number of SQL array dimensions
and the number of columns is always two - lower and upper bounds for
each dimension.
For example, an array defined in InterBase as
INTEGER[2:5][3:10][100:200] is described by the following array of pairs:
sliceBounds[0] = {2, 5}
sliceBounds[1] = {3, 10}
sliceBounds[2] = {100, 200}
sliceBoundsSQLException - if an error occurs while attempting to access the array
public ResultSet getResultSet(int[][] sliceBounds)
throws SQLException
sliceBounds.
The slice is specified by a two-dimensional array sliceBounds.
The number of rows in this array must be equal to the number of SQL array dimensions
and the number of columns is always two - lower and upper bounds for
each dimension.
For example, an array defined in InterBase as
INTEGER[2:5][3:10][100:200] is described by the following array of pairs:
sliceBounds[0] = {2, 5}
sliceBounds[1] = {3, 10}
sliceBounds[2] = {100, 200}
sliceBoundsSQLException - if an error occurs while attempting to access the array
|
2.50.5 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||