src/share/classes/javax/sql/rowset/serial/SerialArray.java

Print this page


   1 /*
   2  * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  33 
  34 
  35 /**
  36  * A serialized version of an <code>Array</code>
  37  * object, which is the mapping in the Java programming language of an SQL
  38  * <code>ARRAY</code> value.
  39  * <P>
  40  * The <code>SerialArray</code> class provides a constructor for creating
  41  * a <code>SerialArray</code> instance from an <code>Array</code> object,
  42  * methods for getting the base type and the SQL name for the base type, and
  43  * methods for copying all or part of a <code>SerialArray</code> object.
  44  * <P>
  45  *
  46  * Note: In order for this class to function correctly, a connection to the
  47  * data source
  48  * must be available in order for the SQL <code>Array</code> object to be
  49  * materialized (have all of its elements brought to the client server)
  50  * if necessary. At this time, logical pointers to the data in the data source,
  51  * such as locators, are not currently supported.
  52  *
  53  * <h4> Thread safety </h4>
  54  *
  55  * A SerialArray is not safe for use by multiple concurrent threads.  If a
  56  * SerialArray is to be used by more than one thread then access to the
  57  * SerialArray should be controlled by appropriate synchronization.
  58  *
  59  */
  60 public class SerialArray implements Array, Serializable, Cloneable {
  61 
  62     /**
  63      * A serialized array in which each element is an <code>Object</code>
  64      * in the Java programming language that represents an element
  65      * in the SQL <code>ARRAY</code> value.
  66      * @serial
  67      */
  68     private Object[] elements;
  69 
  70     /**
  71      * The SQL type of the elements in this <code>SerialArray</code> object.  The
  72      * type is expressed as one of the constants from the class
  73      * <code>java.sql.Types</code>.


   1 /*
   2  * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  33 
  34 
  35 /**
  36  * A serialized version of an <code>Array</code>
  37  * object, which is the mapping in the Java programming language of an SQL
  38  * <code>ARRAY</code> value.
  39  * <P>
  40  * The <code>SerialArray</code> class provides a constructor for creating
  41  * a <code>SerialArray</code> instance from an <code>Array</code> object,
  42  * methods for getting the base type and the SQL name for the base type, and
  43  * methods for copying all or part of a <code>SerialArray</code> object.
  44  * <P>
  45  *
  46  * Note: In order for this class to function correctly, a connection to the
  47  * data source
  48  * must be available in order for the SQL <code>Array</code> object to be
  49  * materialized (have all of its elements brought to the client server)
  50  * if necessary. At this time, logical pointers to the data in the data source,
  51  * such as locators, are not currently supported.
  52  *
  53  * <h3> Thread safety </h3>
  54  *
  55  * A SerialArray is not safe for use by multiple concurrent threads.  If a
  56  * SerialArray is to be used by more than one thread then access to the
  57  * SerialArray should be controlled by appropriate synchronization.
  58  *
  59  */
  60 public class SerialArray implements Array, Serializable, Cloneable {
  61 
  62     /**
  63      * A serialized array in which each element is an <code>Object</code>
  64      * in the Java programming language that represents an element
  65      * in the SQL <code>ARRAY</code> value.
  66      * @serial
  67      */
  68     private Object[] elements;
  69 
  70     /**
  71      * The SQL type of the elements in this <code>SerialArray</code> object.  The
  72      * type is expressed as one of the constants from the class
  73      * <code>java.sql.Types</code>.