Java Doc for SerialArray.java in  » 6.0-JDK-Core » sql » javax » sql » rowset » serial » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » sql » javax.sql.rowset.serial 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.sql.rowset.serial.SerialArray

SerialArray
public class SerialArray implements Array,Serializable,Cloneable(Code)
A serialized version of an Array object, which is the mapping in the Java programming language of an SQL ARRAY value.

The SerialArray class provides a constructor for creating a SerialArray instance from an Array object, methods for getting the base type and the SQL name for the base type, and methods for copying all or part of a SerialArray object.

Note: In order for this class to function correctly, a connection to the data source must be available in order for the SQL Array object to be materialized (have all of its elements brought to the client server) if necessary. At this time, logical pointers to the data in the data source, such as locators, are not currently supported.



Field Summary
final static  longserialVersionUID
     The identifier that assists in the serialization of this SerialArray object.

Constructor Summary
public  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.

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.

public  SerialArray(Array array)
     Constructs a new SerialArray object from the given Array object.

This constructor does not do custom mapping.


Method Summary
public  voidfree()
     This method frees the Array object and releases the resources that it holds.
public  ObjectgetArray()
     Returns a new array that is a copy of this SerialArray object.
public  ObjectgetArray(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.
public  ObjectgetArray(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.
public  ObjectgetArray(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.
public  intgetBaseType()
     Retrieves the SQL type of the elements in this SerialArray object.
public  StringgetBaseTypeName()
     Retrieves the DBMS-specific type name for the elements in this SerialArray object.
public  ResultSetgetResultSet(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.
public  ResultSetgetResultSet(Map<String, Class<?>> map)
     Retrieves a ResultSet object that contains all of the elements of the SQL ARRAY value represented by this SerialArray object.
public  ResultSetgetResultSet()
     Retrieves a ResultSet object that contains all of the elements in the ARRAY value that this SerialArray object represents.
public  ResultSetgetResultSet(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.

Field Detail
serialVersionUID
final static long serialVersionUID(Code)
The identifier that assists in the serialization of this SerialArray object.




Constructor Detail
SerialArray
public SerialArray(Array array, Map<String, Class<?>> map) throws SerialException, SQLException(Code)
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.

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.
Parameters:
  array - the Array object to be serialized
Parameters:
  map - a java.util.Map object in whicheach entry consists of 1) a String objectgiving the fully qualified name of a UDT (an SQL structured type ordistinct type) and 2) theClass object for the SQLData implementationthat defines how the UDT is to be mapped. The map parameter does not have any effect for Blob, Clob, DATALINK, or JAVA_OBJECT types.
throws:
  SerialException - if an error occurs serializing the Array object
throws:
  SQLException - if a database access error occurs or if the array or the map values are null




SerialArray
public SerialArray(Array array) throws SerialException, SQLException(Code)
Constructs a new 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.
Parameters:
  array - the Array object to be serialized
throws:
  SerialException - if an error occurs serializing the Array object
throws:
  SQLException - if a database access error occurs or the array parameter is null.





Method Detail
free
public void free() throws SQLException(Code)
This method frees the Array object and releases the resources that it holds. The object is invalid once the free method is called.

After free has been called, any attempt to invoke a method other than free will result in a SQLException being thrown. If free is called multiple times, the subsequent calls to free are treated as a no-op.


throws:
  SQLException - if an error occurs releasingthe Array's resources
exception:
  SQLFeatureNotSupportedException - if the JDBC driver does not supportthis method
since:
   1.6




getArray
public Object getArray() throws SerialException(Code)
Returns a new array that is a copy of this SerialArray object. a copy of this SerialArray object as anObject in the Java programming language
throws:
  SerialException - if an error occurs retrieving a copy ofthis SerialArray object



getArray
public Object getArray(Map<String, Class<?>> map) throws SerialException(Code)
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.

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.
Parameters:
  map - a java.util.Map object in whicheach entry consists of 1) a String objectgiving the fully qualified name of a UDT and 2) theClass object for the SQLData implementationthat defines how the UDT is to be mapped a copy of this SerialArray object as anObject in the Java programming language
throws:
  SerialException - if an error occurs




getArray
public Object getArray(long index, int count) throws SerialException(Code)
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.
Parameters:
  index - the index into this SerialArray objectof the first element to be copied; the index of the first element is 0
Parameters:
  count - the number of consecutive elements to be copied, startingat the given index a copy of the designated elements in this SerialArrayobject as an Object in the Java programming language
throws:
  SerialException - if an error occurs



getArray
public Object getArray(long index, int count, Map<String, Class<?>> map) throws SerialException(Code)
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.

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.
Parameters:
  index - the index into this SerialArray objectof the first element to be copied; the index of the first element in the array is 0
Parameters:
  count - the number of consecutive elements to be copied, startingat the given index
Parameters:
  map - a java.util.Map object in whicheach entry consists of 1) a String objectgiving the fully qualified name of a UDT and 2) theClass object for the SQLData implementationthat defines how the UDT is to be mapped a copy of the designated elements in this SerialArrayobject as an Object in the Java programming language
throws:
  SerialException - if an error occurs




getBaseType
public int getBaseType() throws SerialException(Code)
Retrieves the SQL type of the elements in this SerialArray object. The int returned is one of the constants in the class java.sql.Types. one of the constants in java.sql.Types, indicatingthe SQL type of the elements in this SerialArray object
throws:
  SerialException - if an error occurs



getBaseTypeName
public String getBaseTypeName() throws SerialException(Code)
Retrieves the DBMS-specific type name for the elements in this SerialArray object. the SQL type name used by the DBMS for the base type of thisSerialArray object
throws:
  SerialException - if an error occurs



getResultSet
public ResultSet getResultSet(long index, int count) throws SerialException(Code)
Retrieves a 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.
Parameters:
  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
Parameters:
  count - the number of consecutive elements to be copied, starting at the given index a ResultSet object containing the designated elements in this SerialArray object, with a separate row for each element
throws:
  SerialException - , which in turn throws an UnsupportedOperationException, if this method is called



getResultSet
public ResultSet getResultSet(Map<String, Class<?>> map) throws SerialException(Code)
Retrieves a 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.
Parameters:
  map - a java.util.Map object in whicheach entry consists of 1) a String objectgiving the fully qualified name of a UDT and 2) theClass object for the SQLData implementationthat defines how the UDT is to be mapped a ResultSet object containing all of the elements in this SerialArray object, with a separate row for each element
throws:
  SerialException - , which in turn throws an UnsupportedOperationException, if this method is called



getResultSet
public ResultSet getResultSet() throws SerialException(Code)
Retrieves a 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. a ResultSet object containing all of the elements in this SerialArray object, with a separate row for each element
throws:
  SerialException - if called, which in turn throws an UnsupportedOperationException, if this method is called



getResultSet
public ResultSet getResultSet(long index, int count, Map<String, Class<?>> map) throws SerialException(Code)
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. 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.
Parameters:
  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
Parameters:
  count - the number of consecutive elements to be copied, starting at the given index
Parameters:
  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 a ResultSet object containing the designated elements in this SerialArray object, with a separate row for each element
throws:
  SerialException - if called, which in turn throws an UnsupportedOperationException



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.