jdk/src/share/classes/javax/sql/rowset/serial/SQLOutputImpl.java
author lancea
Thu, 26 Jan 2012 19:41:35 -0500
changeset 11683 5e02efd89af6
parent 11129 f9ad1aadf3fa
child 14179 4681260d262a
permissions -rw-r--r--
7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl Reviewed-by: forax
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
11683
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
     2
 * Copyright (c) 2003, 2012, 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
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.sql.rowset.serial;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
11683
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
    28
import java.io.BufferedReader;
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
    29
import java.io.IOException;
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
    30
import java.io.InputStreamReader;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.sql.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.util.Map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.util.Vector;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * The output stream for writing the attributes of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * custom-mapped user-defined type (UDT) back to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * The driver uses this interface internally, and its
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * methods are never directly invoked by an application programmer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * When an application calls the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * method <code>PreparedStatement.setObject</code>, the driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * checks to see whether the value to be written is a UDT with
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * a custom mapping.  If it is, there will be an entry in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * type map containing the <code>Class</code> object for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * class that implements <code>SQLData</code> for this UDT.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * If the value to be written is an instance of <code>SQLData</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * the driver will create an instance of <code>SQLOutputImpl</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * and pass it to the method <code>SQLData.writeSQL</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * The method <code>writeSQL</code> in turn calls the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * appropriate <code>SQLOutputImpl.writeXXX</code> methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * to write data from the <code>SQLData</code> object to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * the <code>SQLOutputImpl</code> output stream as the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * representation of an SQL user-defined type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
public class SQLOutputImpl implements SQLOutput {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * A reference to an existing vector that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * contains the attributes of a <code>Struct</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
    62
    @SuppressWarnings("rawtypes")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    private Vector attribs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * The type map the driver supplies to a newly created
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * <code>SQLOutputImpl</code> object.  This type map
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * indicates the <code>SQLData</code> class whose
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * <code>writeSQL</code> method will be called.  This
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * method will in turn call the appropriate
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * <code>SQLOutputImpl</code> writer methods.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
    73
    @SuppressWarnings("rawtypes")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    private Map map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * Creates a new <code>SQLOutputImpl</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * initialized with the given vector of attributes and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * type map.  The driver will use the type map to determine
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * which <code>SQLData.writeSQL</code> method to invoke.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * This method will then call the appropriate
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * <code>SQLOutputImpl</code> writer methods in order and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * thereby write the attributes to the new output stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * @param attributes a <code>Vector</code> object containing the attributes of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     *        the UDT to be mapped to one or more objects in the Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     *        programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * @param map a <code>java.util.Map</code> object containing zero or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     *        more entries, with each entry consisting of 1) a <code>String</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     *        giving the fully qualified name of a UDT and 2) the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     *        <code>Class</code> object for the <code>SQLData</code> implementation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     *        that defines how the UDT is to be mapped
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * @throws SQLException if the <code>attributes</code> or the <code>map</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     *        is a <code>null</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    public SQLOutputImpl(Vector<?> attributes, Map<String,?> map)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        throws SQLException
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        if ((attributes == null) || (map == null)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
            throw new SQLException("Cannot instantiate a SQLOutputImpl " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
            "instance with null parameters");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        this.attribs = attributes;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        this.map = map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    //================================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    // Methods for writing attributes to the stream of SQL data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    // These methods correspond to the column-accessor methods of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    // java.sql.ResultSet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    //================================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * Writes a <code>String</code> in the Java programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * to this <code>SQLOutputImpl</code> object. The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * it to an SQL <code>CHAR</code>, <code>VARCHAR</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * <code>LONGVARCHAR</code> before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   125
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    public void writeString(String x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        //System.out.println("Adding :"+x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        attribs.add(x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * Writes a <code>boolean</code> in the Java programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * to this <code>SQLOutputImpl</code> object. The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * it to an SQL <code>BIT</code> before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   141
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    public void writeBoolean(boolean x) throws SQLException {
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 5506
diff changeset
   143
        attribs.add(Boolean.valueOf(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * Writes a <code>byte</code> in the Java programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * to this <code>SQLOutputImpl</code> object. The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * it to an SQL <code>BIT</code> before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   156
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    public void writeByte(byte x) throws SQLException {
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 5506
diff changeset
   158
        attribs.add(Byte.valueOf(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * Writes a <code>short</code> in the Java programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * to this <code>SQLOutputImpl</code> object. The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * it to an SQL <code>SMALLINT</code> before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   171
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    public void writeShort(short x) throws SQLException {
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 5506
diff changeset
   173
        attribs.add(Short.valueOf(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * Writes an <code>int</code> in the Java programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * to this <code>SQLOutputImpl</code> object. The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * it to an SQL <code>INTEGER</code> before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   186
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    public void writeInt(int x) throws SQLException {
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 5506
diff changeset
   188
        attribs.add(Integer.valueOf(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * Writes a <code>long</code> in the Java programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * to this <code>SQLOutputImpl</code> object. The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * it to an SQL <code>BIGINT</code> before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   201
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    public void writeLong(long x) throws SQLException {
6697
39929804f9d4 6989139: Address JDBC Findbugs where Number type Constructor are used
lancea
parents: 5506
diff changeset
   203
        attribs.add(Long.valueOf(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * Writes a <code>float</code> in the Java programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * to this <code>SQLOutputImpl</code> object. The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * it to an SQL <code>REAL</code> before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   216
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    public void writeFloat(float x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        attribs.add(new Float(x));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * Writes a <code>double</code> in the Java programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * to this <code>SQLOutputImpl</code> object. The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * it to an SQL <code>DOUBLE</code> before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   231
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    public void writeDouble(double x) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
        attribs.add(new Double(x));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * Writes a <code>java.math.BigDecimal</code> object in the Java programming
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * language to this <code>SQLOutputImpl</code> object. The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * it to an SQL <code>NUMERIC</code> before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   246
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    public void writeBigDecimal(java.math.BigDecimal x) throws SQLException{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
        attribs.add(x);
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
     * Writes an array of <code>bytes</code> in the Java programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * to this <code>SQLOutputImpl</code> object. The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * it to an SQL <code>VARBINARY</code> or <code>LONGVARBINARY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   262
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
    public void writeBytes(byte[] x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
        attribs.add(x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * Writes a <code>java.sql.Date</code> object in the Java programming
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * language to this <code>SQLOutputImpl</code> object. The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * it to an SQL <code>DATE</code> before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   277
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
    public void writeDate(java.sql.Date x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
        attribs.add(x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * Writes a <code>java.sql.Time</code> object in the Java programming
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * language to this <code>SQLOutputImpl</code> object. The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * it to an SQL <code>TIME</code> before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   292
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    public void writeTime(java.sql.Time x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
        attribs.add(x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     * Writes a <code>java.sql.Timestamp</code> object in the Java programming
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * language to this <code>SQLOutputImpl</code> object. The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * it to an SQL <code>TIMESTAMP</code> before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   307
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
    public void writeTimestamp(java.sql.Timestamp x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
        attribs.add(x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     * Writes a stream of Unicode characters to this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * <code>SQLOutputImpl</code> object. The driver will do any necessary
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     * conversion from Unicode to the database <code>CHAR</code> format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   322
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
    public void writeCharacterStream(java.io.Reader x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
         BufferedReader bufReader = new BufferedReader(x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
         try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
             int i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
             while( (i = bufReader.read()) != -1 ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
                char ch = (char)i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
                StringBuffer strBuf = new StringBuffer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
                strBuf.append(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
                String str = new String(strBuf);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
                String strLine = bufReader.readLine();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
                writeString(str.concat(strLine));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
         } catch(IOException ioe) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     * Writes a stream of ASCII characters to this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     * <code>SQLOutputImpl</code> object. The driver will do any necessary
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     * conversion from ASCII to the database <code>CHAR</code> format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   352
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
    public void writeAsciiStream(java.io.InputStream x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
         BufferedReader bufReader = new BufferedReader(new InputStreamReader(x));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
         try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
               int i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
               while( (i=bufReader.read()) != -1 ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
                char ch = (char)i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
                StringBuffer strBuf = new StringBuffer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
                strBuf.append(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
                String str = new String(strBuf);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
                String strLine = bufReader.readLine();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
                writeString(str.concat(strLine));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
          }catch(IOException ioe) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
            throw new SQLException(ioe.getMessage());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * Writes a stream of uninterpreted bytes to this <code>SQLOutputImpl</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   382
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
    public void writeBinaryStream(java.io.InputStream x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
         BufferedReader bufReader = new BufferedReader(new InputStreamReader(x));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
         try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
               int i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
             while( (i=bufReader.read()) != -1 ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
                char ch = (char)i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
                StringBuffer strBuf = new StringBuffer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
                strBuf.append(ch);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
                String str = new String(strBuf);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
                String strLine = bufReader.readLine();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
                writeString(str.concat(strLine));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
             }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
        } catch(IOException ioe) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
            throw new SQLException(ioe.getMessage());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
    //================================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
    // Methods for writing items of SQL user-defined types to the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
    // These methods pass objects to the database as values of SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
    // Structured Types, Distinct Types, Constructed Types, and Locator
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
    // Types.  They decompose the Java object(s) and write leaf data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
    // items using the methods above.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
    //================================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * Writes to the stream the data contained in the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * <code>SQLData</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * When the <code>SQLData</code> object is <code>null</code>, this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * method writes an SQL <code>NULL</code> to the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     * Otherwise, it calls the <code>SQLData.writeSQL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     * method of the given object, which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     * writes the object's attributes to the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * The implementation of the method <code>SQLData.writeSQ</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * calls the appropriate <code>SQLOutputImpl.writeXXX</code> method(s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * for writing each of the object's attributes in order.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * The attributes must be read from an <code>SQLInput</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * input stream and written to an <code>SQLOutputImpl</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * output stream in the same order in which they were
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * listed in the SQL definition of the user-defined type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * @param x the object representing data of an SQL structured or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     *          distinct type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   434
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
    public void writeObject(SQLData x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
         * Except for the types that are passed as objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
         * this seems to be the only way for an object to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
         * get a null value for a field in a structure.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
         * Note: this means that the class defining SQLData
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
         * will need to track if a field is SQL null for itself
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
        if (x == null) {
11683
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   446
            attribs.add(null);
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   447
        } else {
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   448
            /*
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   449
             * We have to write out a SerialStruct that contains
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   450
             * the name of this class otherwise we don't know
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   451
             * what to re-instantiate during readSQL()
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   452
             */
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   453
            attribs.add(new SerialStruct(x, map));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * Writes a <code>Ref</code> object in the Java programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     * to this <code>SQLOutputImpl</code> object.  The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     * it to a serializable <code>SerialRef</code> SQL <code>REF</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * @param x an object representing an SQL <code>REF</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   468
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
    public void writeRef(Ref x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
        if (x == null) {
11683
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   471
            attribs.add(null);
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   472
        } else {
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   473
            attribs.add(new SerialRef(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     * Writes a <code>Blob</code> object in the Java programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
     * to this <code>SQLOutputImpl</code> object.  The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     * it to a serializable <code>SerialBlob</code> SQL <code>BLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     * before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     * @param x an object representing an SQL <code>BLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   488
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
    public void writeBlob(Blob x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
        if (x == null) {
11683
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   491
            attribs.add(null);
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   492
        } else {
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   493
            attribs.add(new SerialBlob(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * Writes a <code>Clob</code> object in the Java programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * to this <code>SQLOutputImpl</code> object.  The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     * it to a serializable <code>SerialClob</code> SQL <code>CLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     * before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     * @param x an object representing an SQL <code>CLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   508
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
    public void writeClob(Clob x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
        if (x == null) {
11683
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   511
            attribs.add(null);
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   512
        } else {
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   513
            attribs.add(new SerialClob(x));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     * Writes a <code>Struct</code> object in the Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     * programming language to this <code>SQLOutputImpl</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * object. The driver converts this value to an SQL structured type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     * before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     * This method should be used when an SQL structured type has been
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     * mapped to a <code>Struct</code> object in the Java programming
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     * language (the standard mapping).  The method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     * <code>writeObject</code> should be used if an SQL structured type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
     * has been custom mapped to a class in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     * @param x an object representing the attributes of an SQL structured type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   534
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
    public void writeStruct(Struct x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
        SerialStruct s = new SerialStruct(x,map);;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
        attribs.add(s);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
     * Writes an <code>Array</code> object in the Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     * programming language to this <code>SQLOutputImpl</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     * object. The driver converts this value to a serializable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * <code>SerialArray</code> SQL <code>ARRAY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     * value before returning it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     * @param x an object representing an SQL <code>ARRAY</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   552
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
    public void writeArray(Array x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
        if (x == null) {
11683
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   555
            attribs.add(null);
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   556
        } else {
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   557
            attribs.add(new SerialArray(x, map));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     * Writes an <code>java.sql.Type.DATALINK</code> object in the Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
     * programming language to this <code>SQLOutputImpl</code> object. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
     * driver converts this value to a serializable <code>SerialDatalink</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
     * SQL <code>DATALINK</code> value before return it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
     * @param url an object representing a SQL <code>DATALINK</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     * @throws SQLException if the <code>SQLOutputImpl</code> object is in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     *        use by a <code>SQLData</code> object attempting to write the attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     *        values of a UDT to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
     */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   572
    @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
    public void writeURL(java.net.URL url) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
        if (url == null) {
11683
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   575
            attribs.add(null);
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   576
        } else {
5e02efd89af6 7133815: address the findbug errors in CachedRowSetImpl, SerialStruct, BaseRow, SerialInputImpl, SerialOutputImpl
lancea
parents: 11129
diff changeset
   577
            attribs.add(new SerialDatalink(url));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
   * Writes the next attribute to the stream as a <code>String</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
   * in the Java programming language. The driver converts this to a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
   * SQL <code>NCHAR</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
   * <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
   * (depending on the argument's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
   * size relative to the driver's limits on <code>NVARCHAR</code> values)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
   * when it sends it to the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
   * @param x the value to pass to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
   * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
   * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
   */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   595
   @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
   public void writeNString(String x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
        throw new UnsupportedOperationException("Operation not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
   * Writes an SQL <code>NCLOB</code> value to the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
   * @param x a <code>NClob</code> object representing data of an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
   * <code>NCLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
   * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
   * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
   */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   609
   @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
   public void writeNClob(NClob x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
        throw new UnsupportedOperationException("Operation not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
   * Writes an SQL <code>ROWID</code> value to the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
   * @param x a <code>RowId</code> object representing data of an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
   * <code>ROWID</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
   * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
   * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
   */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   624
   @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
   public void writeRowId(RowId x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
        throw new UnsupportedOperationException("Operation not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
   * Writes an SQL <code>XML</code> value to the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
   * @param x a <code>SQLXML</code> object representing data of an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
   * <code>XML</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
   *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
   * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
   * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
   */
11129
f9ad1aadf3fa 7116445: Miscellaneous warnings in the JDBC/RowSet classes
lancea
parents: 6697
diff changeset
   639
   @SuppressWarnings("unchecked")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
   public void writeSQLXML(SQLXML x) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
        throw new UnsupportedOperationException("Operation not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
}