src/java.sql/share/classes/java/sql/SQLInput.java
author lucy
Mon, 09 Oct 2017 11:43:42 +0200
changeset 47606 660175b829e8
parent 47216 71c04702a3d5
permissions -rw-r--r--
8187964: [s390][ppc]: Intrinsify Math.multiplyHigh(long, long) Reviewed-by: mdoerr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
15643
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
     2
 * Copyright (c) 1998, 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 java.sql;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * An input stream that contains a stream of values representing an
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * instance of an SQL structured type or an SQL distinct type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * This interface, used only for custom mapping, is used by the driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * behind the scenes, and a programmer never directly invokes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * <code>SQLInput</code> methods. The <i>reader</i> methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * (<code>readLong</code>, <code>readBytes</code>, and so on)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * provide a way  for an implementation of the <code>SQLData</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 *  interface to read the values in an <code>SQLInput</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 *  And as described in <code>SQLData</code>, calls to reader methods must
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * be made in the order that their corresponding attributes appear in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * SQL definition of the type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * The method <code>wasNull</code> is used to determine whether
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * the last value read was SQL <code>NULL</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * <P>When the method <code>getObject</code> is called with an
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * object of a class implementing the interface <code>SQLData</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * the JDBC driver calls the method <code>SQLData.getSQLType</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * to determine the SQL type of the user-defined type (UDT)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * being custom mapped. The driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * creates an instance of <code>SQLInput</code>, populating it with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * attributes of the UDT.  The driver then passes the input
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * stream to the method <code>SQLData.readSQL</code>, which in turn
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * calls the <code>SQLInput</code> reader methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * in its implementation for reading the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * attributes from the input stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
public interface SQLInput {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    //================================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    // Methods for reading attributes from the stream of SQL data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    // These methods correspond to the column-accessor methods of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    // java.sql.ResultSet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    //================================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * Reads the next attribute in the stream and returns it as a <code>String</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    String readString() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * Reads the next attribute in the stream and returns it as a <code>boolean</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>false</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    boolean readBoolean() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * Reads the next attribute in the stream and returns it as a <code>byte</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    byte readByte() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * Reads the next attribute in the stream and returns it as a <code>short</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    short readShort() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * Reads the next attribute in the stream and returns it as an <code>int</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    int readInt() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * Reads the next attribute in the stream and returns it as a <code>long</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    long readLong() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * Reads the next attribute in the stream and returns it as a <code>float</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    float readFloat() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * Reads the next attribute in the stream and returns it as a <code>double</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>0</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    double readDouble() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * Reads the next attribute in the stream and returns it as a <code>java.math.BigDecimal</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * object in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    java.math.BigDecimal readBigDecimal() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * Reads the next attribute in the stream and returns it as an array of bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    byte[] readBytes() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * Reads the next attribute in the stream and returns it as a <code>java.sql.Date</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    java.sql.Date readDate() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * Reads the next attribute in the stream and returns it as a <code>java.sql.Time</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    java.sql.Time readTime() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * Reads the next attribute in the stream and returns it as a <code>java.sql.Timestamp</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    java.sql.Timestamp readTimestamp() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * Reads the next attribute in the stream and returns it as a stream of Unicode characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    java.io.Reader readCharacterStream() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * Reads the next attribute in the stream and returns it as a stream of ASCII characters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    java.io.InputStream readAsciiStream() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * Reads the next attribute in the stream and returns it as a stream of uninterpreted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    java.io.InputStream readBinaryStream() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    //================================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
    // Methods for reading items of SQL user-defined types from the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    //================================================================
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * Reads the datum at the head of the stream and returns it as an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * <code>Object</code> in the Java programming language.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * actual type of the object returned is determined by the default type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * mapping, and any customizations present in this stream's type map.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * <P>A type map is registered with the stream by the JDBC driver before the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * stream is passed to the application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * <P>When the datum at the head of the stream is an SQL <code>NULL</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * the method returns <code>null</code>.  If the datum is an SQL structured or distinct
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * type, it determines the SQL type of the datum at the head of the stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * If the stream's type map has an entry for that SQL type, the driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * constructs an object of the appropriate class and calls the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * <code>SQLData.readSQL</code> on that object, which reads additional data from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * stream, using the protocol described for that method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * @return the datum at the head of the stream as an <code>Object</code> in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     * Java programming language;<code>null</code> if the datum is SQL <code>NULL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
    Object readObject() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * Reads an SQL <code>REF</code> value from the stream and returns it as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * <code>Ref</code> object in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     * @return a <code>Ref</code> object representing the SQL <code>REF</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     * at the head of the stream; <code>null</code> if the value read is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * SQL <code>NULL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
    Ref readRef() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * Reads an SQL <code>BLOB</code> value from the stream and returns it as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     * <code>Blob</code> object in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * @return a <code>Blob</code> object representing data of the SQL <code>BLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * at the head of the stream; <code>null</code> if the value read is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * SQL <code>NULL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
    Blob readBlob() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * Reads an SQL <code>CLOB</code> value from the stream and returns it as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * <code>Clob</code> object in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * @return a <code>Clob</code> object representing data of the SQL <code>CLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     * at the head of the stream; <code>null</code> if the value read is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     * SQL <code>NULL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
    Clob readClob() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * Reads an SQL <code>ARRAY</code> value from the stream and returns it as an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     * <code>Array</code> object in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * @return an <code>Array</code> object representing data of the SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * <code>ARRAY</code> value at the head of the stream; <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * if the value read is SQL <code>NULL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
    Array readArray() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     * Retrieves whether the last value read was SQL <code>NULL</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     * @return <code>true</code> if the most recently read SQL value was SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * <code>NULL</code>; <code>false</code> otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
    boolean wasNull() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
    //---------------------------- JDBC 3.0 -------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * Reads an SQL <code>DATALINK</code> value from the stream and returns it as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * <code>java.net.URL</code> object in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     * @return a <code>java.net.URL</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     *            or if a URL is malformed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
    java.net.URL readURL() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     //---------------------------- JDBC 4.0 -------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     * Reads an SQL <code>NCLOB</code> value from the stream and returns it as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     * <code>NClob</code> object in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     * @return a <code>NClob</code> object representing data of the SQL <code>NCLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     * at the head of the stream; <code>null</code> if the value read is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * SQL <code>NULL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
    NClob readNClob() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * Reads the next attribute in the stream and returns it as a <code>String</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * in the Java programming language. It is intended for use when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * accessing  <code>NCHAR</code>,<code>NVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     * and <code>LONGNVARCHAR</code> columns.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
     * @return the attribute; if the value is SQL <code>NULL</code>, returns <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
    String readNString() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     * Reads an SQL <code>XML</code> value from the stream and returns it as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     * <code>SQLXML</code> object in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     * @return a <code>SQLXML</code> object representing data of the SQL <code>XML</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * at the head of the stream; <code>null</code> if the value read is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     * SQL <code>NULL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
    SQLXML readSQLXML() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * Reads an SQL <code>ROWID</code> value from the stream and returns it as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * <code>RowId</code> object in the Java programming language.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * @return a <code>RowId</code> object representing data of the SQL <code>ROWID</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * at the head of the stream; <code>null</code> if the value read is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     * SQL <code>NULL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
    RowId readRowId() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
15643
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   424
    //--------------------------JDBC 4.2 -----------------------------
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   425
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   426
    /**
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   427
     * Reads the next attribute in the stream and returns it as an
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   428
     * {@code Object} in the Java programming language. The
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   429
     * actual type of the object returned is determined by the specified
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   430
     * Java data type, and any customizations present in this
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   431
     * stream's type map.
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   432
     *
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   433
     * <P>A type map is registered with the stream by the JDBC driver before the
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   434
     * stream is passed to the application.
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   435
     *
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   436
     * <P>When the attribute at the head of the stream is an SQL {@code NULL}
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   437
     * the method returns {@code null}. If the attribute is an SQL
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   438
     * structured or distinct
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   439
     * type, it determines the SQL type of the attribute at the head of the stream.
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   440
     * If the stream's type map has an entry for that SQL type, the driver
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   441
     * constructs an object of the appropriate class and calls the method
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   442
     * {@code SQLData.readSQL} on that object, which reads additional data from the
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   443
     * stream, using the protocol described for that method.
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   444
     *<p>
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   445
     * The default implementation will throw {@code SQLFeatureNotSupportedException}
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   446
     *
18574
4aeaeb541678 8019380: doclint warnings in java.nio, java.nio.file.**, java.nio.channels.**
alanb
parents: 18564
diff changeset
   447
     * @param <T> the type of the class modeled by this Class object
15643
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   448
     * @param type Class representing the Java data type to convert the attribute to.
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   449
     * @return the attribute at the head of the stream as an {@code Object} in the
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   450
     * Java programming language;{@code null} if the attribute is SQL {@code NULL}
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   451
     * @exception SQLException if a database access error occurs
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   452
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   453
     * this method
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   454
     * @since 1.8
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   455
     */
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   456
    default <T> T readObject(Class<T> type) throws SQLException {
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   457
       throw new SQLFeatureNotSupportedException();
5e3b735b74ac 8006505: additional changes for JSR 310 support
lancea
parents: 5506
diff changeset
   458
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
}