|
Préférences
Moteurs de recherche
|
|||||||||||||||||||||||||||||
JavaTM 2 Platform Std. Ed. v1.5.0
javax.sql.rowset.serial
|
Constructor Summary | |
---|---|
SerialArray(Array array)
Constructs a new SerialArray object from the given
Array object. |
|
SerialArray(Array array,
Map<String,Class<?>> map)
Constructs a new SerialArray object from the given
Array object, using the given type map for the custom
mapping of each element when the elements are SQL UDTs. |
Method Summary | |
---|---|
Object |
getArray()
Returns a new array that is a copy of this SerialArray
object. |
Object |
getArray(long index,
int count)
Returns a new array that is a copy of a slice of this SerialArray object, starting with the
element at the given index and containing the given number
of consecutive elements. |
Object |
getArray(long index,
int count,
Map<String,Class<?>> map)
Returns a new array that is a copy of a slice of this SerialArray object, starting with the
element at the given index and containing the given number
of consecutive elements. |
Object |
getArray(Map<String,Class<?>> map)
Returns a new array that is a copy of this SerialArray
object, using the given type map for the custom
mapping of each element when the elements are SQL UDTs. |
int |
getBaseType()
Retrieves the SQL type of the elements in this SerialArray
object. |
String |
getBaseTypeName()
Retrieves the DBMS-specific type name for the elements in this SerialArray object. |
ResultSet |
getResultSet()
Retrieves a ResultSet object that contains all of
the elements in the ARRAY value that this
SerialArray object represents. |
ResultSet |
getResultSet(long index,
int count)
Retrieves a ResultSet object 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<String,Class<?>> map)
Retrieves a result set holding the elements of the subarray that starts at Retrieves a ResultSet object that contains a subarray of the
elements in this SerialArray object, starting at
index index and containing up to count successive
elements. |
ResultSet |
getResultSet(Map<String,Class<?>> map)
Retrieves a ResultSet object that contains all of
the elements of the SQL ARRAY
value represented by this SerialArray object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SerialArray(Array array, Map<String,Class<?>> map) throws SerialException, SQLException
SerialArray
object from the given
Array
object, using the given type map for the custom
mapping of each element when the elements are SQL UDTs.
This method does custom mapping if the array elements are a UDT and the given type map has an entry for that UDT. Custom mapping is recursive, meaning that if, for instance, an element of an SQL structured type is an SQL structured type that itself has an element that is an SQL structured type, each structured type that has a custom mapping will be mapped according to the given type map.
The new SerialArray
object contains the same elements as the Array
object
from which it is built, except when the base type is the SQL type
STRUCT
, ARRAY
, BLOB
,
CLOB
, DATALINK
or JAVA_OBJECT
.
In this case, each element in the new
SerialArray
object is the appropriate serialized form,
that is, a SerialStruct
, SerialArray
,
SerialBlob
, SerialClob
,
SerialDatalink
, or SerialJavaObject
object.
Note: (1) The Array
object from which a SerialArray
object is created must have materialized the SQL ARRAY
value's
data on the client before it is passed to the constructor. Otherwise,
the new SerialArray
object will contain no data.
Note: (2) If the Array
contains java.sql.Types.JAVA_OBJECT
types, the SerialJavaObject
constructor is called where checks
are made to ensure this object is serializable.
Note: (3) The Array
object supplied to this constructor cannot
return null
for any Array.getArray()
methods.
SerialArray
cannot serialize null array values.
array
- the Array
object to be serializedmap
- a java.util.Map
object in which
each entry consists of 1) a String
object
giving the fully qualified name of a UDT (an SQL structured type or
distinct type) and 2) the
Class
object for the SQLData
implementation
that defines how the UDT is to be mapped. The map
parameter does not have any effect for Blob
,
Clob
, DATALINK
, or
JAVA_OBJECT
types.
SerialException
- if an error occurs serializing the
Array
object
SQLException
- if a database access error occurs or if the
array or the map values are null
public SerialArray(Array array) throws SerialException, SQLException
SerialArray
object from the given
Array
object.
This constructor does not do custom mapping. If the base type of the array
is an SQL structured type and custom mapping is desired, the constructor
SerialArray(Array array, Map map)
should be used.
The new SerialArray
object contains the same elements as the Array
object
from which it is built, except when the base type is the SQL type
BLOB
,
CLOB
, DATALINK
or JAVA_OBJECT
.
In this case, each element in the new
SerialArray
object is the appropriate serialized form,
that is, a SerialBlob
, SerialClob
,
SerialDatalink
, or SerialJavaObject
object.
Note: (1) The Array
object from which a SerialArray
object is created must have materialized the SQL ARRAY
value's
data on the client before it is passed to the constructor. Otherwise,
the new SerialArray
object will contain no data.
Note: (2) The Array
object supplied to this constructor cannot
return null
for any Array.getArray()
methods.
SerialArray
cannot serialize null
array values.
array
- the Array
object to be serialized
SerialException
- if an error occurs serializing the
Array
object
SQLException
- if a database access error occurs or the
array parameter is null
.Method Detail |
---|
public Object getArray() throws SerialException
SerialArray
object.
SerialArray
object as an
Object
in the Java programming language
SerialException
- if an error occurs retrieving a copy of
this SerialArray
objectpublic Object getArray(Map<String,Class<?>> map) throws SerialException
SerialArray
object, using the given type map for the custom
mapping of each element when the elements are SQL UDTs.
This method does custom mapping if the array elements are a UDT and the given type map has an entry for that UDT. Custom mapping is recursive, meaning that if, for instance, an element of an SQL structured type is an SQL structured type that itself has an element that is an SQL structured type, each structured type that has a custom mapping will be mapped according to the given type map.
map
- a java.util.Map
object in which
each entry consists of 1) a String
object
giving the fully qualified name of a UDT and 2) the
Class
object for the SQLData
implementation
that defines how the UDT is to be mapped
SerialArray
object as an
Object
in the Java programming language
SerialException
- if an error occurspublic Object getArray(long index, int count) throws SerialException
SerialArray
object, starting with the
element at the given index and containing the given number
of consecutive elements.
index
- the index into this SerialArray
object
of the first element to be copied;
the index of the first element is 0
count
- the number of consecutive elements to be copied, starting
at the given index
SerialArray
object as an Object
in the Java programming language
SerialException
- if an error occurspublic Object getArray(long index, int count, Map<String,Class<?>> map) throws SerialException
SerialArray
object, starting with the
element at the given index and containing the given number
of consecutive elements.
This method does custom mapping if the array elements are a UDT and the given type map has an entry for that UDT. Custom mapping is recursive, meaning that if, for instance, an element of an SQL structured type is an SQL structured type that itself has an element that is an SQL structured type, each structured type that has a custom mapping will be mapped according to the given type map.
index
- the index into this SerialArray
object
of the first element to be copied; the index of the
first element in the array is 0
count
- the number of consecutive elements to be copied, starting
at the given indexmap
- a java.util.Map
object in which
each entry consists of 1) a String
object
giving the fully qualified name of a UDT and 2) the
Class
object for the SQLData
implementation
that defines how the UDT is to be mapped
SerialArray
object as an Object
in the Java programming language
SerialException
- if an error occurspublic int getBaseType() throws SerialException
SerialArray
object. The int
returned is one of the constants in the class
java.sql.Types
.
getBaseType
in interface Array
java.sql.Types
, indicating
the SQL type of the elements in this SerialArray
object
SerialException
- if an error occurspublic String getBaseTypeName() throws SerialException
SerialArray
object.
getBaseTypeName
in interface Array
SerialArray
object
SerialException
- if an error occurspublic ResultSet getResultSet(long index, int count) throws SerialException
ResultSet
object 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.
getResultSet
in interface Array
index
- the index into this SerialArray
object
of the first element to be copied; the index of the
first element in the array is 0
count
- the number of consecutive elements to be copied, starting
at the given index
ResultSet
object containing the designated
elements in this SerialArray
object, with a
separate row for each element
SerialException,
- which in turn throws an
UnsupportedOperationException
, if this method is called
SerialException
public ResultSet getResultSet(Map<String,Class<?>> map) throws SerialException
ResultSet
object that contains all of
the elements of the SQL ARRAY
value represented by this SerialArray
object. This method uses
the specified map for type map customizations unless the base type of the
array does not match a user-defined type (UDT) in map, in
which case it uses the
standard mapping. This version of the method getResultSet
uses either the given type map or the standard mapping; it never uses the
type map associated with the connection.
getResultSet
in interface Array
map
- a java.util.Map
object in which
each entry consists of 1) a String
object
giving the fully qualified name of a UDT and 2) the
Class
object for the SQLData
implementation
that defines how the UDT is to be mapped
ResultSet
object containing all of the
elements in this SerialArray
object, with a
separate row for each element
SerialException,
- which in turn throws an
UnsupportedOperationException
, if this method is called
SerialException
public ResultSet getResultSet() throws SerialException
ResultSet
object that contains all of
the elements in the ARRAY
value that this
SerialArray
object represents.
If appropriate, the elements of the array are mapped using the connection's
type map; otherwise, the standard mapping is used.
getResultSet
in interface Array
ResultSet
object containing all of the
elements in this SerialArray
object, with a
separate row for each element
SerialException
- if called, which in turn throws an
UnsupportedOperationException
, if this method is calledpublic ResultSet getResultSet(long index, int count, Map<String,Class<?>> map) throws SerialException
ResultSet
object that contains a subarray of the
elements in this SerialArray
object, starting at
index index and containing up to count successive
elements. This method uses
the specified map for type map customizations unless the base type of the
array does not match a user-defined type (UDT) in map, in
which case it uses the
standard mapping. This version of the method getResultSet
uses
either the given type map or the standard mapping; it never uses the type
map associated with the connection.
getResultSet
in interface Array
index
- the index into this SerialArray
object
of the first element to be copied; the index of the
first element in the array is 0
count
- the number of consecutive elements to be copied, starting
at the given indexmap
- a java.util.Map
object in which
each entry consists of 1) a String
object
giving the fully qualified name of a UDT and 2) the
Class
object for the SQLData
implementation
that defines how the UDT is to be mapped
ResultSet
object containing the designated
elements in this SerialArray
object, with a
separate row for each element
SerialException
- if called, which in turn throws an
UnsupportedOperationException