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