public class ARRAY extends DatumWithConnection implements oracle.jdbc.internal.OracleArray, oracle.jdbc.internal.OracleConcreteProxy
Array
interface for declaration instead of using concrete class
oracle.sql.ARRAY. java.sql.Array has methods declared for all opertions.
For Oracle specific methods use the interface OracleArray
.
Obtaining java.sql.Array from the ResultSet
java.sql.Array array = resultSet.getArray(...);
Creating a new java.sql.Array using factory method.
OracleConnection.createOracleArray(java.lang.String, java.lang.Object)
should be used to
create java.sql.Array. Connection.createArrayOf(java.lang.String, java.lang.Object[])
throws
an exception since Oracle does not support creation of anonymous array type.
java.sql.Array array = ((oracle.jdbc.OracleConnection)connection).createOracleArray((...);
Modifier and Type | Field and Description |
---|---|
static int |
ACCESS_FORWARD
Deprecated.
|
static int |
ACCESS_REVERSE
Deprecated.
|
static int |
ACCESS_UNKNOWN
Deprecated.
|
protected oracle.jdbc.driver.OracleArray |
target
Deprecated.
|
targetDatumWithConnection
ojiOracleDatumWithConnection, targetDatum
Constructor and Description |
---|
ARRAY(ArrayDescriptor type,
Connection conn,
Object elements)
Deprecated.
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
dump()
Deprecated.
Create a string which show the contents of this Array and
of all its component parts.
|
void |
free()
Deprecated.
Currently does nothing.
|
int |
getAccessDirection()
Deprecated.
Performance hint.
|
Object |
getArray()
Deprecated.
Implements Array interface method
Retrieve the contents of the SQL array designated by the object.
|
Object |
getArray(long index,
int count)
Deprecated.
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.
|
Object |
getArray(long index,
int count,
Map map)
Deprecated.
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.
|
Object |
getArray(Map map)
Deprecated.
Implements Array interface method
Retrieve the contents of the SQL array designated by this
object.
|
boolean |
getAutoBuffering()
Deprecated.
Performance hint.
|
boolean |
getAutoIndexing()
Deprecated.
Performance hint.
|
int |
getBaseType()
Deprecated.
Implements Array interface method
Determine the code, from java.sql.Types, of the type of
the elements of the array.
|
String |
getBaseTypeName()
Deprecated.
Implements Array interface method
Returns the SQL type name of the elements in
the array designated by this
Array object. |
Datum[] |
getDatumArray()
Deprecated.
|
ArrayDescriptor |
getDescriptor()
Deprecated.
Oracle extension.
|
double[] |
getDoubleArray()
Deprecated.
Oracle extension.
|
double[] |
getDoubleArray(long index,
int count)
Deprecated.
Oracle extension.
|
float[] |
getFloatArray()
Deprecated.
Oracle extension.
|
float[] |
getFloatArray(long index,
int count)
Deprecated.
Oracle extension.
|
int[] |
getIntArray()
Deprecated.
Oracle extension.
|
int[] |
getIntArray(long index,
int count)
Deprecated.
Oracle extension.
|
Map<?,?> |
getJavaMap()
Deprecated.
Implements Array interface method
Retrieves the contents of the SQL associative array designated by the object.
|
long[] |
getLongArray()
Deprecated.
Oracle extension.
|
long[] |
getLongArray(long index,
int count)
Deprecated.
Oracle extension.
|
int |
getNumElems()
Deprecated.
|
Object |
getObjArray()
Deprecated.
|
Datum[] |
getOracleArray()
Deprecated.
Oracle extension.
|
Datum[] |
getOracleArray(long index,
int count)
Deprecated.
Oracle extension.
|
OracleTypeMetaData |
getOracleMetaData()
Deprecated.
Return the type data for this object
|
ResultSet |
getResultSet()
Deprecated.
Implements Array interface method
Returns a result set that contains the elements of the array
designated by this
Array object. |
ResultSet |
getResultSet(long index,
int count)
Deprecated.
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. |
ResultSet |
getResultSet(long index,
int count,
Map map)
Deprecated.
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. |
ResultSet |
getResultSet(Map map)
Deprecated.
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. |
short[] |
getShortArray()
Deprecated.
Oracle extension.
|
short[] |
getShortArray(long index,
int count)
Deprecated.
|
String |
getSQLTypeName()
Deprecated.
Oracle extension.
|
oracle.jdbc.driver.OracleArray |
getTarget()
Deprecated.
|
boolean |
isConvertibleTo(Class<?> jClass)
Deprecated.
Oracle extension.
|
int |
length()
Deprecated.
Oracle extension.
|
void |
setAutoBuffering(boolean enable)
Deprecated.
Performance hint.
|
void |
setAutoIndexing(boolean enable)
Deprecated.
Performance hint.
|
void |
setAutoIndexing(boolean enable,
int direction)
Deprecated.
Performance hint.
|
void |
setNullObjArray()
Deprecated.
|
String |
stringValue()
Deprecated.
Convert to a String representation of the datum object
|
Object |
toJdbc()
Deprecated.
Oracle extension.
|
Object |
toJdbc(Map map)
Deprecated.
Oracle extension.
|
assertNotNull, assertNotNull, getConnection, getConnectionDuringExceptionHandling, getJavaSqlConnection, getOracleConnection
asciiStreamValue, bigDecimalValue, binaryStreamValue, booleanValue, bytesEqual, bytesHashCode, byteValue, characterStreamValue, compareBytes, dateValue, doubleValue, equals, floatValue, getBytes, getLength, getStream, intValue, isNull, longValue, setBytes, setShareBytes, shareBytes, stringValue, timestampValue, timestampValue, timeValue, timeValue, toClass
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asciiStreamValue, bigDecimalValue, binaryStreamValue, booleanValue, byteValue, characterStreamValue, dateValue, doubleValue, floatValue, getBytes, getConnection, getInternalConnection, getJavaSqlConnection, getLength, getOracleConnection, getStream, intValue, longValue, setBytes, setPhysicalConnectionOf, setShareBytes, shareBytes, stringValue, timestampValue, timestampValue, timeValue, timeValue
public static final int ACCESS_FORWARD
public static final int ACCESS_REVERSE
public static final int ACCESS_UNKNOWN
protected oracle.jdbc.driver.OracleArray target
public ARRAY(ArrayDescriptor type, Connection conn, Object elements) throws SQLException
type
- an ArrayDescriptor describing the SQL Typeelements
- the contents of the array. These objects will
be converted to raw bytes of the appropriate SQL TypeSQLException
public oracle.jdbc.driver.OracleArray getTarget()
public String getBaseTypeName() throws SQLException
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.getBaseTypeName
in interface Array
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 UDTSQLException
- if an error occurs while attempting
to access the type namepublic int getBaseType() throws SQLException
getBaseType
in interface Array
SQLException
Types
,
OracleTypes
public Object getArray() throws SQLException
getArray
in interface Array
SQLException
public Map<?,?> getJavaMap() throws SQLException
getJavaMap
in interface OracleArray
SQLException
public Object getArray(Map map) throws SQLException
getArray
in interface Array
map
- contains mapping of SQL type names to Java classesSQLException
public Object getArray(long index, int count) throws SQLException
getArray
in interface Array
index
- the array-index of the first element to retrievecount
- the number of successive SQL array elements to retrieveSQLException
public Object getArray(long index, int count, Map map) throws SQLException
getArray
in interface Array
index
- the array-index of the first element to retrievecount
- the number of successive SQL array elements to retrievemap
- contains mapping of SQL user-defined types to classesSQLException
public ResultSet getResultSet() throws SQLException
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.
getResultSet
in interface Array
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.SQLException
- if an error occurs while attempting to
access the arraypublic ResultSet getResultSet(Map map) throws SQLException
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.
getResultSet
in interface Array
map
- 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 arraypublic 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 Array
index
- 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 arraypublic 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 Array
index
- 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 arraypublic Datum[] getOracleArray() throws SQLException
SQLException
public int length() throws SQLException
length
in interface OracleArray
SQLException
public Datum[] getOracleArray(long index, int count) throws SQLException
index
- the index of the first element to be returnedcount
- the number of elements to be returned.SQLException
public String getSQLTypeName() throws SQLException
Struct
object represents.getSQLTypeName
in interface OracleArray
Array
object
is the generic representationSQLException
- if a database access error occurspublic OracleTypeMetaData getOracleMetaData() throws SQLException
getOracleMetaData
in interface OracleArray
SQLException
- if an error occurspublic ArrayDescriptor getDescriptor() throws SQLException
SQLException
public Object toJdbc() throws SQLException
toJdbc
in interface oracle.jdbc.internal.OracleDatumWithConnection
toJdbc
in interface OracleArray
toJdbc
in class Datum
SQLException
- if conversion to JDBC representation results in
an errorpublic Object toJdbc(Map map) throws SQLException
SQLException
public boolean isConvertibleTo(Class<?> jClass)
isConvertibleTo
in interface oracle.jdbc.internal.OracleDatumWithConnection
isConvertibleTo
in class Datum
jClass
- Class to convert topublic int[] getIntArray() throws SQLException
getIntArray
in interface OracleArray
SQLException
public int[] getIntArray(long index, int count) throws SQLException
getIntArray
in interface OracleArray
index
- the index of the first element to be returnedcount
- the number of elements to be returned.SQLException
public double[] getDoubleArray() throws SQLException
getDoubleArray
in interface OracleArray
SQLException
public double[] getDoubleArray(long index, int count) throws SQLException
getDoubleArray
in interface OracleArray
index
- the index of the first element to be returnedcount
- the number of elements to be returned.SQLException
public short[] getShortArray() throws SQLException
getShortArray
in interface OracleArray
SQLException
public short[] getShortArray(long index, int count) throws SQLException
getShortArray
in interface OracleArray
SQLException
public long[] getLongArray() throws SQLException
getLongArray
in interface OracleArray
SQLException
public long[] getLongArray(long index, int count) throws SQLException
getLongArray
in interface OracleArray
index
- the index of the first element to be returnedcount
- the number of elements to be returned.SQLException
public float[] getFloatArray() throws SQLException
getFloatArray
in interface OracleArray
SQLException
public float[] getFloatArray(long index, int count) throws SQLException
getFloatArray
in interface OracleArray
index
- the index of the first element to be returnedcount
- the number of elements to be returned.SQLException
public void setAutoBuffering(boolean enable) throws SQLException
enable
- - true enables auto-buffering; false disables auto-bufferingSQLException
getAutoBuffering()
public boolean getAutoBuffering() throws SQLException
SQLException
setAutoBuffering(boolean)
public void setAutoIndexing(boolean enable, int direction) throws SQLException
enable
- - true enables auto-indexing; false disables auto-indexingdirection
- - overwrite default access direction.SQLException
public void setAutoIndexing(boolean enable) throws SQLException
enable
- - true enables auto-indexing; false disables auto-indexingSQLException
public boolean getAutoIndexing() throws SQLException
SQLException
oracle.sql.ARRAY#setAutoIndexinging(boolean)
,
oracle.sql.ARRAY#setAutoIndexinging(boolean, int)
public int getAccessDirection() throws SQLException
SQLException
oracle.sql.ARRAY#setAutoIndexinging(boolean)
,
oracle.sql.ARRAY#setAutoIndexinging(boolean, int)
public String dump() throws SQLException
SQLException
public String stringValue() throws SQLException
Datum
stringValue
in interface oracle.jdbc.internal.OracleDatumWithConnection
stringValue
in class Datum
SQLException
public void free() throws SQLException
free
in interface Array
SQLException
public int getNumElems()
public Datum[] getDatumArray()
public Object getObjArray()
public void setNullObjArray()