src/java.sql.rowset/share/classes/javax/sql/rowset/serial/SQLInputImpl.java
author pliden
Wed, 20 Nov 2019 10:37:46 +0100
changeset 59152 59272e9e0635
parent 47216 71c04702a3d5
permissions -rw-r--r--
8234383: Test TestBiasedLockRevocationEvents.java assumes -XX:UseBiasedLocking is enabled Reviewed-by: mgronlun, tschatzl
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 23915
diff changeset
     2
 * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
package javax.sql.rowset.serial;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
import java.sql.*;
11683
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
    28
import java.util.Arrays;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.util.Map;
23915
db277d7621af 8028385: Enhance RowSet Factory
lancea
parents: 15277
diff changeset
    30
import sun.reflect.misc.ReflectUtil;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * An input stream used for custom mapping user-defined types (UDTs).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * An <code>SQLInputImpl</code> object is an input stream that contains a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * stream of values that are the attributes of a UDT.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * This class is used by the driver behind the scenes when the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * <code>getObject</code> is called on an SQL structured or distinct type
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * that has a custom mapping; a programmer never invokes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * <code>SQLInputImpl</code> methods directly. They are provided here as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * convenience for those who write <code>RowSet</code> implementations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * The <code>SQLInputImpl</code> class provides a set of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * reader methods analogous to the <code>ResultSet</code> getter
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * methods.  These methods make it possible to read the values in an
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * <code>SQLInputImpl</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * The method <code>wasNull</code> is used to determine whether the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * the last value read was SQL <code>NULL</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * <P>When the method <code>getObject</code> is called with an
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * object of a class implementing the interface <code>SQLData</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * the JDBC driver calls the method <code>SQLData.getSQLType</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * to determine the SQL type of the UDT being custom mapped. The driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * creates an instance of <code>SQLInputImpl</code>, populating it with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * attributes of the UDT.  The driver then passes the input
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * stream to the method <code>SQLData.readSQL</code>, which in turn
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * calls the <code>SQLInputImpl</code> reader methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * to read the attributes from the input stream.
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
    59
 * @since 1.5
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * @see java.sql.SQLData
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
public class SQLInputImpl implements SQLInput {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * <code>true</code> if the last value returned was <code>SQL NULL</code>;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * <code>false</code> otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    private boolean lastValueWasNull;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * The current index into the array of SQL structured type attributes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * that will be read from this <code>SQLInputImpl</code> object and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * mapped to the fields of a class in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    private int idx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * The array of attributes to be read from this stream.  The order
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * of the attributes is the same as the order in which they were
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * listed in the SQL definition of the UDT.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    private Object attrib[];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * The type map to use when the method <code>readObject</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * is invoked. This is a <code>java.util.Map</code> object in which
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * there may be zero or more entries.  Each entry consists of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * fully qualified name of a UDT (the value to be mapped) and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * <code>Class</code> object for a class that implements
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * <code>SQLData</code> (the Java class that defines how the UDT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * will be mapped).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 5506
diff changeset
    93
    private Map<String,Class<?>> map;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * Creates an <code>SQLInputImpl</code> object initialized with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * given array of attributes and the given type map. If any of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * attributes is a UDT whose name is in an entry in the type map,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * the attribute will be mapped according to the corresponding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * <code>SQLData</code> implementation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * @param attributes an array of <code>Object</code> instances in which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     *        each element is an attribute of a UDT. The order of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     *        attributes in the array is the same order in which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     *        the attributes were defined in the UDT definition.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * @param map a <code>java.util.Map</code> object containing zero or more
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     *        entries, with each entry consisting of 1) a <code>String</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     *        giving the fully
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     *        qualified name of the UDT and 2) the <code>Class</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     *        for the <code>SQLData</code> implementation that defines how
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     *        the UDT is to be mapped
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * @throws SQLException if the <code>attributes</code> or the <code>map</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     *        is a <code>null</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    public SQLInputImpl(Object[] attributes, Map<String,Class<?>> map)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        throws SQLException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        if ((attributes == null) || (map == null)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
            throw new SQLException("Cannot instantiate a SQLInputImpl " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
            "object with null parameters");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        // assign our local reference to the attribute stream
11683
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   125
        attrib = Arrays.copyOf(attributes, attributes.length);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        // init the index point before the head of the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        idx = -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        // set the map
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        this.map = map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * Retrieves the next attribute in this <code>SQLInputImpl</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * as an <code>Object</code> in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * @return the next value in the input stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     *         as an <code>Object</code> in the Java programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     *         position or if there are no further values in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    private Object getNextAttribute() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        if (++idx >= attrib.length) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
            throw new SQLException("SQLInputImpl exception: Invalid read " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
                                   "position");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        } else {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   147
            lastValueWasNull = attrib[idx] == null;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
            return attrib[idx];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    //================================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    // Methods for reading attributes from the stream of SQL data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    // These methods correspond to the column-accessor methods of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    // java.sql.ResultSet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    //================================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * Retrieves the next attribute in this <code>SQLInputImpl</code> object as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * a <code>String</code> in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * returned type is the expected type; this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * to the UDT mapping as defined by a <code>SQLData</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * implementation.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 23915
diff changeset
   167
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * @return the next attribute in this <code>SQLInputImpl</code> object;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     *     if the value is <code>SQL NULL</code>, return <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     *     position or if there are no further values in the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    public String readString() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   174
        return  (String)getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * Retrieves the next attribute in this <code>SQLInputImpl</code> object as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * a <code>boolean</code> in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * returned type is the expected type; this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * to the UDT mapping as defined by a <code>SQLData</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * implementation.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 23915
diff changeset
   185
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * @return the next attribute in this <code>SQLInputImpl</code> object;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     *     if the value is <code>SQL NULL</code>, return <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     *     position or if there are no further values in the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    public boolean readBoolean() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        Boolean attrib = (Boolean)getNextAttribute();
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   193
        return  (attrib == null) ? false : attrib.booleanValue();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * Retrieves the next attribute in this <code>SQLInputImpl</code> object as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * a <code>byte</code> in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * returned type is the expected type; this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * to the UDT mapping as defined by a <code>SQLData</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * implementation.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 23915
diff changeset
   204
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * @return the next attribute in this <code>SQLInputImpl</code> object;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     *     if the value is <code>SQL NULL</code>, return <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     *     position or if there are no further values in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    public byte readByte() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        Byte attrib = (Byte)getNextAttribute();
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   212
        return  (attrib == null) ? 0 : attrib.byteValue();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * Retrieves the next attribute in this <code>SQLInputImpl</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * as a <code>short</code> in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * returned type is the expected type; this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * to the UDT mapping as defined by a <code>SQLData</code> implementation.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 23915
diff changeset
   222
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * @return the next attribute in this <code>SQLInputImpl</code> object;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     *       if the value is <code>SQL NULL</code>, return <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     *       position or if there are no more values in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    public short readShort() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
        Short attrib = (Short)getNextAttribute();
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   230
        return (attrib == null) ? 0 : attrib.shortValue();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * Retrieves the next attribute in this <code>SQLInputImpl</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * as an <code>int</code> in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * returned type is the expected type; this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * to the UDT mapping as defined by a <code>SQLData</code> implementation.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 23915
diff changeset
   240
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * @return the next attribute in this <code>SQLInputImpl</code> object;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     *       if the value is <code>SQL NULL</code>, return <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     *       position or if there are no more values in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    public int readInt() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
        Integer attrib = (Integer)getNextAttribute();
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   248
        return (attrib == null) ? 0 : attrib.intValue();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * Retrieves the next attribute in this <code>SQLInputImpl</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * as a <code>long</code> in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * returned type is the expected type; this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * to the UDT mapping as defined by a <code>SQLData</code> implementation.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 23915
diff changeset
   258
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * @return the next attribute in this <code>SQLInputImpl</code> object;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     *       if the value is <code>SQL NULL</code>, return <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     *       position or if there are no more values in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    public long readLong() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
        Long attrib = (Long)getNextAttribute();
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   266
        return (attrib == null) ? 0 : attrib.longValue();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * Retrieves the next attribute in this <code>SQLInputImpl</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * as a <code>float</code> in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     * returned type is the expected type; this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * to the UDT mapping as defined by a <code>SQLData</code> implementation.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 23915
diff changeset
   276
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     * @return the next attribute in this <code>SQLInputImpl</code> object;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     *       if the value is <code>SQL NULL</code>, return <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     *       position or if there are no more values in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
    public float readFloat() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
        Float attrib = (Float)getNextAttribute();
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   284
        return (attrib == null) ? 0 : attrib.floatValue();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * Retrieves the next attribute in this <code>SQLInputImpl</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     * as a <code>double</code> in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * returned type is the expected type; this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * to the UDT mapping as defined by a <code>SQLData</code> implementation.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 23915
diff changeset
   294
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * @return the next attribute in this <code>SQLInputImpl</code> object;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     *       if the value is <code>SQL NULL</code>, return <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     *       position or if there are no more values in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
    public double readDouble() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
        Double attrib = (Double)getNextAttribute();
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   302
        return (attrib == null)  ? 0 :  attrib.doubleValue();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * Retrieves the next attribute in this <code>SQLInputImpl</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     * as a <code>java.math.BigDecimal</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     * returned type is the expected type; this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * to the UDT mapping as defined by a <code>SQLData</code> implementation.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 23915
diff changeset
   312
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     * @return the next attribute in this <code>SQLInputImpl</code> object;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     *       if the value is <code>SQL NULL</code>, return <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     *       position or if there are no more values in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
    public java.math.BigDecimal readBigDecimal() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   319
        return (java.math.BigDecimal)getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * Retrieves the next attribute in this <code>SQLInputImpl</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * as an array of bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     * returned type is the expected type; this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * to the UDT mapping as defined by a <code>SQLData</code> implementation.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 23915
diff changeset
   329
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * @return the next attribute in this <code>SQLInputImpl</code> object;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     *       if the value is <code>SQL NULL</code>, return <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     *       position or if there are no more values in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
    public byte[] readBytes() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   336
        return (byte[])getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     * Retrieves the next attribute in this <code>SQLInputImpl</code> as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     * a <code>java.sql.Date</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     * returned type is the expected type; this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     * to the UDT mapping as defined by a <code>SQLData</code> implementation.
24197
a5c2cff81e25 8039488: Tidy warnings cleanup for javax.sql
yan
parents: 23915
diff changeset
   346
     *
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     * @return the next attribute in this <code>SQLInputImpl</code> object;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     *       if the value is <code>SQL NULL</code>, return <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     *       position or if there are no more values in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
    public java.sql.Date readDate() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   353
        return (java.sql.Date)getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     * Retrieves the next attribute in this <code>SQLInputImpl</code> object as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * a <code>java.sql.Time</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     * returned type is the expected type as this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     * to the UDT mapping as implemented by a <code>SQLData</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * implementation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * @return the attribute; if the value is <code>SQL NULL</code>, return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * position; or if there are no further values in the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
    public java.sql.Time readTime() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   371
        return (java.sql.Time)getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * Retrieves the next attribute in this <code>SQLInputImpl</code> object as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * a <code>java.sql.Timestamp</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     * @return the attribute; if the value is <code>SQL NULL</code>, return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     * <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     * position; or if there are no further values in the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
    public java.sql.Timestamp readTimestamp() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   384
        return (java.sql.Timestamp)getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
     * Retrieves the next attribute in this <code>SQLInputImpl</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
     * as a stream of Unicode characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     * returned type is the expected type as this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * to the UDT mapping as implemented by a <code>SQLData</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * implementation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     * @return the attribute; if the value is <code>SQL NULL</code>, return <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     * position; or if there are no further values in the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
    public java.io.Reader readCharacterStream() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   401
        return (java.io.Reader)getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     * Returns the next attribute in this <code>SQLInputImpl</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     * as a stream of ASCII characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     * returned type is the expected type as this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     * to the UDT mapping as implemented by a <code>SQLData</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * implementation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * @return the attribute; if the value is <code>SQL NULL</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * return <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     * position; or if there are no further values in the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
    public java.io.InputStream readAsciiStream() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   419
        return (java.io.InputStream)getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * Returns the next attribute in this <code>SQLInputImpl</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * as a stream of uninterpreted bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * returned type is the expected type as this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * to the UDT mapping as implemented by a <code>SQLData</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     * implementation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * @return the attribute; if the value is <code>SQL NULL</code>, return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     * <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * position; or if there are no further values in the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
    public java.io.InputStream readBinaryStream() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   437
        return (java.io.InputStream)getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    //================================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
    // Methods for reading items of SQL user-defined types from the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
    //================================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * Retrieves the value at the head of this <code>SQLInputImpl</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * object as an <code>Object</code> in the Java programming language.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * actual type of the object returned is determined by the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     * mapping of SQL types to types in the Java programming language unless
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     * there is a custom mapping, in which case the type of the object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     * returned is determined by this stream's type map.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     * The JDBC technology-enabled driver registers a type map with the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     * before passing the stream to the application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     * When the datum at the head of the stream is an SQL <code>NULL</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * this method returns <code>null</code>.  If the datum is an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     * structured or distinct type with a custom mapping, this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * determines the SQL type of the datum at the head of the stream,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     * constructs an object of the appropriate class, and calls the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     * <code>SQLData.readSQL</code> on that object. The <code>readSQL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * method then calls the appropriate <code>SQLInputImpl.readXXX</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     * methods to retrieve the attribute values from the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * @return the value at the head of the stream as an <code>Object</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     *         in the Java programming language; <code>null</code> if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     *         the value is SQL <code>NULL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     * position; or if there are no further values in the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
    public Object readObject() throws SQLException {
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 5506
diff changeset
   471
        Object attrib = getNextAttribute();
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   472
        if (attrib instanceof Struct) {
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   473
            Struct s = (Struct)attrib;
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   474
            // look up the class in the map
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   475
            Class<?> c = map.get(s.getSQLTypeName());
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   476
            if (c != null) {
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   477
                // create new instance of the class
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   478
                SQLData obj = null;
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   479
                try {
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents: 25859
diff changeset
   480
                    ReflectUtil.checkPackageAccess(c);
37782
ad8fe7507ecc 6850612: Deprecate Class.newInstance since it violates the checked exception language contract
darcy
parents: 36511
diff changeset
   481
                    @SuppressWarnings("deprecation")
ad8fe7507ecc 6850612: Deprecate Class.newInstance since it violates the checked exception language contract
darcy
parents: 36511
diff changeset
   482
                    Object tmp = c.newInstance();
ad8fe7507ecc 6850612: Deprecate Class.newInstance since it violates the checked exception language contract
darcy
parents: 36511
diff changeset
   483
                    obj = (SQLData)tmp;
23915
db277d7621af 8028385: Enhance RowSet Factory
lancea
parents: 15277
diff changeset
   484
                } catch (Exception ex) {
db277d7621af 8028385: Enhance RowSet Factory
lancea
parents: 15277
diff changeset
   485
                    throw new SQLException("Unable to Instantiate: ", ex);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
                }
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   487
                // get the attributes from the struct
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   488
                Object attribs[] = s.getAttributes(map);
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   489
                // create the SQLInput "stream"
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   490
                SQLInputImpl sqlInput = new SQLInputImpl(attribs, map);
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   491
                // read the values...
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   492
                obj.readSQL(sqlInput, s.getSQLTypeName());
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   493
                return obj;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
        }
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   496
        return attrib;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     * Retrieves the value at the head of this <code>SQLInputImpl</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     * as a <code>Ref</code> object in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     * @return a <code>Ref</code> object representing the SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     *         <code>REF</code> value at the head of the stream; if the value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     *         is <code>SQL NULL</code> return <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     *         position; or if there are no further values in the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
    public Ref readRef() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   510
        return (Ref)getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
     * Retrieves the <code>BLOB</code> value at the head of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     * <code>SQLInputImpl</code> object as a <code>Blob</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
     * in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     * returned type is the expected type as this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * to the UDT mapping as implemented by a <code>SQLData</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     * implementation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     * @return a <code>Blob</code> object representing the SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     *         <code>BLOB</code> value at the head of this stream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     *         if the value is <code>SQL NULL</code>, return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     *         <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     * position; or if there are no further values in the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
    public Blob readBlob() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   531
        return (Blob)getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     * Retrieves the <code>CLOB</code> value at the head of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     * <code>SQLInputImpl</code> object as a <code>Clob</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     * in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     * returned type is the expected type as this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
     * to the UDT mapping as implemented by a <code>SQLData</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     * implementation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * @return a <code>Clob</code> object representing the SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     *         <code>CLOB</code> value at the head of the stream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     *         if the value is <code>SQL NULL</code>, return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     *         <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     * position; or if there are no further values in the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
    public Clob readClob() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   552
        return (Clob)getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     * Reads an SQL <code>ARRAY</code> value from the stream and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     * returns it as an <code>Array</code> object in the Java programming
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     * language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     * returned type is the expected type as this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     * to the UDT mapping as implemented by a <code>SQLData</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
     * implementation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
     * @return an <code>Array</code> object representing the SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
     *         <code>ARRAY</code> value at the head of the stream; *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
     *         if the value is <code>SQL NULL</code>, return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     *         <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     * position; or if there are no further values in the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
    public Array readArray() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   574
        return (Array)getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
     * Ascertains whether the last value read from this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
     * <code>SQLInputImpl</code> object was <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
     * @return <code>true</code> if the SQL value read most recently was
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
     *         <code>null</code>; otherwise, <code>false</code>; by default it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
     *         will return false
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
     * @throws SQLException if an error occurs determining the last value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     *         read was a <code>null</code> value or not;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
    public boolean wasNull() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
        return lastValueWasNull;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
     * Reads an SQL <code>DATALINK</code> value from the stream and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
     * returns it as an <code>URL</code> object in the Java programming
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     * language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     * This method does not perform type-safe checking to determine if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     * returned type is the expected type as this responsibility is delegated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
     * to the UDT mapping as implemented by a <code>SQLData</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     * implementation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
     * @return an <code>URL</code> object representing the SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
     *         <code>DATALINK</code> value at the head of the stream; *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
     *         if the value is <code>SQL NULL</code>, return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
     *         <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
     * @throws SQLException if the read position is located at an invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
     * position; or if there are no further values in the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
    public java.net.URL readURL() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   609
        return (java.net.URL)getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
    //---------------------------- JDBC 4.0 -------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
     * Reads an SQL <code>NCLOB</code> value from the stream and returns it as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
     * <code>Clob</code> object in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
     * @return a <code>NClob</code> object representing data of the SQL <code>NCLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
     * at the head of the stream; <code>null</code> if the value read is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
     * SQL <code>NULL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
     * @exception SQLException if a database access error occurs
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   622
     * @since 1.6
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
     public NClob readNClob() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   625
        return (NClob)getNextAttribute();
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   626
     }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
     * Reads the next attribute in the stream and returns it as a <code>String</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
     * in the Java programming language. It is intended for use when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
     * accessing  <code>NCHAR</code>,<code>NVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
     * and <code>LONGNVARCHAR</code> columns.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
     * @exception SQLException if a database access error occurs
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   636
     * @since 1.6
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
    public String readNString() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   639
        return (String)getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
     * Reads an SQL <code>XML</code> value from the stream and returns it as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
     * <code>SQLXML</code> object in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
     * @return a <code>SQLXML</code> object representing data of the SQL <code>XML</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
     * at the head of the stream; <code>null</code> if the value read is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
     * SQL <code>NULL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
     * @exception SQLException if a database access error occurs
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   650
     * @since 1.6
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
    public SQLXML readSQLXML() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   653
        return (SQLXML)getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   656
    /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
     * Reads an SQL <code>ROWID</code> value from the stream and returns it as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
     * <code>RowId</code> object in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
     * @return a <code>RowId</code> object representing data of the SQL <code>ROWID</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
     * at the head of the stream; <code>null</code> if the value read is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
     * SQL <code>NULL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
     * @exception SQLException if a database access error occurs
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   664
     * @since 1.6
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
    public RowId readRowId() throws SQLException {
15277
245068ba31b3 8006139: add missing methods to javax.sql.rowset.serial.SQLInputImpl, SQLOutputImpl
lancea
parents: 11683
diff changeset
   667
        return  (RowId)getNextAttribute();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
}