All Packages Class Hierarchy This Package Previous Next Index
Class oracle.sql.ARRAY
oracle.sql.ARRAY
- public class ARRAY
- implements Array
-
ARRAY(ArrayDescriptor, Connection, Object)
- Constructor.
-
getArray()
- Implements Array interface method
Retrieve the contents of the SQL array designated by the object.
-
getArray(Dictionary)
- Implements Array interface method
Retrieve the contents of the SQL array designated by this
object.
-
getArray(long, int)
- Implements Array interface method
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.
-
getArray(long, int, Dictionary)
- Implements Array interface method
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.
-
getBaseType()
- Implements Array interface method
Determine the code, from java.sql.Types, of the type of
the elements of the array.
-
getBaseTypeName()
- Implements Array interface method
Returns the SQL type name of the elements in
the array designated by this
Array
object.
-
getConnection()
- Oracle extension.
-
getDescriptor()
- Oracle extension.
-
getOracleArray()
- Oracle extension.
-
getOracleArray(long, int)
- Oracle extension.
-
getResultSet()
- Implements Array interface method
Returns a result set that contains the elements of the array
designated by this
Array
object.
-
getResultSet(Dictionary)
- Implements Array interface method
Returns a result set that contains the elements of the array
designated by this
Array
object and uses the given
map
to map the array elements.
-
getResultSet(long, int)
- Implements Array interface method
Returns a result set holding the elements of the subarray that
starts at index
index
and contains up to
count
successive elements.
-
getResultSet(long, int, Dictionary)
- Implements Array interface method
Returns a result set holding the elements of the subarray that
starts at index
index
and contains up to
count
successive elements.
-
getSQLTypeName()
- Oracle extension.
-
isConvertibleTo(Class)
- Oracle extension.
-
length()
- Oracle extension.
-
toJdbc()
-
Oracle extension.
ARRAY
public ARRAY(ArrayDescriptor type,
Connection conn,
Object elements) throws SQLException
- Constructor.
- Parameters:
- descriptor - an ArrayDescriptor describing the SQL Type
- elements - the contents of the array. These objects will
be converted to raw bytes of the appropriate SQL Type
getBaseTypeName
public String getBaseTypeName() throws SQLException
- Implements Array interface method
Returns the SQL type name of the elements in
the array designated by this
Array
object.
If the elements are a built-in type, it returns
the database-specific type name of the elements.
If the elements are a user-defined type (UDT),
this method returns the fully-qualified SQL type name.
- Returns:
- a
String
that is the database-specific
name for a built-in base type or the fully-qualified SQL type
name for a base type that is a UDT
- Throws: SQLException
- if an error occurs while attempting
to access the type name
getBaseType
public int getBaseType() throws SQLException
- Implements Array interface method
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.
- See Also:
- Types, OracleTypes
getArray
public Object getArray() throws SQLException
- Implements Array interface method
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.
- Returns:
- a Java array containing the ordered elements of the SQL
array designated by this object.
getArray
public Object getArray(Dictionary map) throws SQLException
- Implements Array interface method
Retrieve the contents of the SQL array designated by this
object. Use the given map for type-map customizations.
- 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
- Implements Array interface method
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.
- 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.
getArray
public Object getArray(long index,
int count,
Dictionary map) throws SQLException
- Implements Array interface method
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:
- 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.
getResultSet
public ResultSet getResultSet() throws SQLException
- Implements Array interface method
Returns a result set that contains the elements of the array
designated by this
Array
object. If appropriate,
the elements of the array are mapped using the connection's type
map; otherwise, the standard mapping is used.
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.
- Returns:
- a {@link ResultSet} 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.
- Throws: SQLException
- if an error occurs while attempting to
access the array
getResultSet
public ResultSet getResultSet(Dictionary map) throws SQLException
- Implements Array interface method
Returns a result set that contains the elements of the array
designated by this
Array
object and uses the given
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.
- Parameters:
- map - contains mapping of SQL user-defined types to
classes in the Java(tm) programming language
- Returns:
- a
ResultSet
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.
- Throws: SQLException
- if an error occurs while attempting to
access the array
getResultSet
public ResultSet getResultSet(long index,
int count) throws SQLException
- Implements Array interface method
Returns a result set holding the elements of the subarray that
starts at index
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.
- Parameters:
- index - the array index of the first element to retrieve;
the first element is at index 1
- count - the number of successive SQL array elements to retrieve
- Returns:
- a
ResultSet
object containing up to
count
consecutive elements of the SQL array
designated by this Array
object, starting at
index index
.
- Throws: SQLException
- if an error occurs while attempting to
access the array
getResultSet
public ResultSet getResultSet(long index,
int count,
Dictionary map) throws SQLException
- Implements Array interface method
Returns a result set holding the elements of the subarray that
starts at index
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.
- Parameters:
- index - the array index of the first element to retrieve;
the first element is at index 1
- count - the number of successive SQL array elements to retrieve
- map - the
Map
object that contains the mapping
of SQL type names to classes in the Java(tm) programming language
- Returns:
- a
ResultSet
object containing up to
count
consecutive elements of the SQL array
designated by this Array
object, starting at
index index
.
- Throws: SQLException
- if an error occurs while attempting to
access the array
getOracleArray
public Datum[] getOracleArray() throws SQLException
- Oracle extension.
Analogous to getArray except that it always returns an oracle.sql.XXX
instead of whatever result.getObject would have returned.
- Returns:
- an array of Datum.
length
public int length() throws SQLException
- Oracle extension.
Get array size.
- Returns:
- the number of elements in the array.
getOracleArray
public Object getOracleArray(long index,
int count) throws SQLException
- Oracle extension.
Like getOracleArray, but returns a slice.
- Parameters:
- index - the index of the first element to be returned
- count - the number of elements to be returned.
- Returns:
- an array containing count elements starting at index
getSQLTypeName
public String getSQLTypeName() throws SQLException
- Oracle extension.
Retrieves the SQL type name of the SQL structured type
that this
Struct
object represents.
- Returns:
- s the fully-qualified type name of the SQL collection
type for which this
Array
object
is the generic representation
- Throws: SQLException
- if a database access error occurs
getDescriptor
public ArrayDescriptor getDescriptor() throws SQLException
- Oracle extension.
Return the ArrayDescriptor object that contains the
type information.
- Returns:
- the type descriptor
getConnection
public OracleConnection getConnection() throws SQLException
- Oracle extension.
The OracleConnection object associatesg the array.
toJdbc
public Object toJdbc() throws SQLException
- Oracle extension.
Returns the JDBC representation of the datum object
- Returns:
- an object containing the JDBC value
- Throws: SQLException
- if conversion to JDBC representation results in
an error
isConvertibleTo
public boolean isConvertibleTo(Class jClass)
- Oracle extension.
Determines if datum object can be converted to a particular class
- Parameters:
- cls - Class to convert to
- Returns:
- true, if conversion to cls is permitted
false, if conversion to cls is not permitted
All Packages Class Hierarchy This Package Previous Next Index