src/java.sql/share/classes/java/sql/PreparedStatement.java
author herrick
Wed, 20 Nov 2019 10:17:37 -0500
branchJDK-8200758-branch
changeset 59160 e90068e7afa1
parent 57548 1f05f7952295
permissions -rw-r--r--
JDK-8234402: revert change that stopped providing JPackageToolProvider Reviewed-by: asemenyuk, almatvee, kcr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
41889
54d1ff9312ce 8169020: Add since element to JDBC deprecated methods
lancea
parents: 25991
diff changeset
     2
 * Copyright (c) 1996, 2016, 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
import java.math.BigDecimal;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.util.Calendar;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.io.Reader;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.io.InputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * An object that represents a precompiled SQL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * <P>A SQL statement is precompiled and stored in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * <code>PreparedStatement</code> object. This object can then be used to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * efficiently execute this statement multiple times.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * <P><B>Note:</B> The setter methods (<code>setShort</code>, <code>setString</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * and so on) for setting IN parameter values
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * must specify types that are compatible with the defined SQL type of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * the input parameter. For instance, if the IN parameter has SQL type
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * <code>INTEGER</code>, then the method <code>setInt</code> should be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * <p>If arbitrary parameter type conversions are required, the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * <code>setObject</code> should be used with a target SQL type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * In the following example of setting a parameter, <code>con</code> represents
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * an active connection:
57548
1f05f7952295 8226808: PreparedStatement javadoc typo
lancea
parents: 47216
diff changeset
    50
 * <pre>{@code
1f05f7952295 8226808: PreparedStatement javadoc typo
lancea
parents: 47216
diff changeset
    51
 *   BigDecimal sal = new BigDecimal("153833.00");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 *   PreparedStatement pstmt = con.prepareStatement("UPDATE EMPLOYEES
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 *                                     SET SALARY = ? WHERE ID = ?");
57548
1f05f7952295 8226808: PreparedStatement javadoc typo
lancea
parents: 47216
diff changeset
    54
 *   pstmt.setBigDecimal(1, sal);
1f05f7952295 8226808: PreparedStatement javadoc typo
lancea
parents: 47216
diff changeset
    55
 *   pstmt.setInt(2, 110592);
1f05f7952295 8226808: PreparedStatement javadoc typo
lancea
parents: 47216
diff changeset
    56
 * }</pre>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * @see Connection#prepareStatement
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * @see ResultSet
44256
12050b22e372 8176721: @since value errors java.sql module
mli
parents: 41889
diff changeset
    60
 * @since 1.1
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
public interface PreparedStatement extends Statement {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * Executes the SQL query in this <code>PreparedStatement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * and returns the <code>ResultSet</code> object generated by the query.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * @return a <code>ResultSet</code> object that contains the data produced by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     *         query; never <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * @exception SQLException if a database access error occurs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * this method is called on a closed  <code>PreparedStatement</code> or the SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     *            statement does not return a <code>ResultSet</code> object
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    74
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    75
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    76
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    77
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    ResultSet executeQuery() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * Executes the SQL statement in this <code>PreparedStatement</code> object,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * which must be an SQL Data Manipulation Language (DML) statement, such as <code>INSERT</code>, <code>UPDATE</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * <code>DELETE</code>; or an SQL statement that returns nothing,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * such as a DDL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * @return either (1) the row count for SQL Data Manipulation Language (DML) statements
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     *         or (2) 0 for SQL statements that return nothing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * @exception SQLException if a database access error occurs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * this method is called on a closed  <code>PreparedStatement</code>
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    91
     * or the SQL statement returns a <code>ResultSet</code> object
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    92
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    93
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    94
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    95
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    int executeUpdate() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * Sets the designated parameter to SQL <code>NULL</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * <P><B>Note:</B> You must specify the parameter's SQL type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * @param sqlType the SQL type code defined in <code>java.sql.Types</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     *  <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * or  <code>STRUCT</code> data type and the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * this data type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    void setNull(int parameterIndex, int sqlType) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * Sets the designated parameter to the given Java <code>boolean</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * to an SQL <code>BIT</code> or <code>BOOLEAN</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * marker in the SQL statement;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    void setBoolean(int parameterIndex, boolean x) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * Sets the designated parameter to the given Java <code>byte</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * to an SQL <code>TINYINT</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    void setByte(int parameterIndex, byte x) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * Sets the designated parameter to the given Java <code>short</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * to an SQL <code>SMALLINT</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    void setShort(int parameterIndex, short x) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * Sets the designated parameter to the given Java <code>int</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * to an SQL <code>INTEGER</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    void setInt(int parameterIndex, int x) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * Sets the designated parameter to the given Java <code>long</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * to an SQL <code>BIGINT</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    void setLong(int parameterIndex, long x) 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
     * Sets the designated parameter to the given Java <code>float</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * to an SQL <code>REAL</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    void setFloat(int parameterIndex, float x) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * Sets the designated parameter to the given Java <code>double</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * to an SQL <code>DOUBLE</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    void setDouble(int parameterIndex, double x) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * Sets the designated parameter to the given <code>java.math.BigDecimal</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * The driver converts this to an SQL <code>NUMERIC</code> value when
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * Sets the designated parameter to the given Java <code>String</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     * to an SQL <code>VARCHAR</code> or <code>LONGVARCHAR</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     * (depending on the argument's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * size relative to the driver's limits on <code>VARCHAR</code> values)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    void setString(int parameterIndex, String x) 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
     * Sets the designated parameter to the given Java array of bytes.  The driver converts
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * this to an SQL <code>VARBINARY</code> or <code>LONGVARBINARY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * (depending on the argument's size relative to the driver's limits on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * <code>VARBINARY</code> values) when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    void setBytes(int parameterIndex, byte x[]) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * Sets the designated parameter to the given <code>java.sql.Date</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * using the default time zone of the virtual machine that is running
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * the application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * to an SQL <code>DATE</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
    void setDate(int parameterIndex, java.sql.Date x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
            throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * Sets the designated parameter to the given <code>java.sql.Time</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * The driver converts this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * to an SQL <code>TIME</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    void setTime(int parameterIndex, java.sql.Time x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
            throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     * The driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     * converts this to an SQL <code>TIMESTAMP</code> value when it sends it to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * this method is called on a closed <code>PreparedStatement</code>     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
    void setTimestamp(int parameterIndex, java.sql.Timestamp x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
            throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * Sets the designated parameter to the given input stream, which will have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * the specified number of bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     * <code>java.io.InputStream</code>. Data will be read from the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     * as needed until end-of-file is reached.  The JDBC driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * do any necessary conversion from ASCII to the database char format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * @param x the Java input stream that contains the ASCII parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     * @param length the number of bytes in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
    void setAsciiStream(int parameterIndex, java.io.InputStream x, int length)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
            throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * Sets the designated parameter to the given input stream, which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * will have the specified number of bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * When a very large Unicode value is input to a <code>LONGVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     * <code>java.io.InputStream</code> object. The data will be read from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * stream as needed until end-of-file is reached.  The JDBC driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * do any necessary conversion from Unicode to the database char format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     *The byte format of the Unicode stream must be a Java UTF-8, as defined in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     *Java Virtual Machine Specification.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     * @param x a <code>java.io.InputStream</code> object that contains the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     *        Unicode parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     * @param length the number of bytes in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     * this method is called on a closed <code>PreparedStatement</code>
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
14171
94eb36844bd7 7197395: Add @Deprecated to all deprecated methods to eliminate compiler warnings in JDBC
lancea
parents: 11016
diff changeset
   347
     * @deprecated Use {@code setCharacterStream}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     */
41889
54d1ff9312ce 8169020: Add since element to JDBC deprecated methods
lancea
parents: 25991
diff changeset
   349
    @Deprecated(since="1.2")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
    void setUnicodeStream(int parameterIndex, java.io.InputStream x,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
                          int length) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * Sets the designated parameter to the given input stream, which will have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * the specified number of bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     * When a very large binary value is input to a <code>LONGVARBINARY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * <code>java.io.InputStream</code> object. The data will be read from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     * stream as needed until end-of-file is reached.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * @param x the java input stream which contains the binary parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * @param length the number of bytes in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
    void setBinaryStream(int parameterIndex, java.io.InputStream x,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
                         int length) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * Clears the current parameter values immediately.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * <P>In general, parameter values remain in force for repeated use of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     * statement. Setting a parameter value automatically clears its
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     * previous value.  However, in some cases it is useful to immediately
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     * release the resources used by the current parameter values; this can
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     * be done by calling the method <code>clearParameters</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
    void clearParameters() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
    //----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
    // Advanced features:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    * Sets the value of the designated parameter with the given object.
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   393
    *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   394
    * This method is similar to {@link #setObject(int parameterIndex,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   395
    * Object x, int targetSqlType, int scaleOrLength)},
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   396
    * except that it assumes a scale of zero.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
    *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
    * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
    * @param x the object containing the input parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
    * @param targetSqlType the SQL type (as defined in java.sql.Types) to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
    *                      sent to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
    * @exception SQLException if parameterIndex does not correspond to a parameter
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   403
    * marker in the SQL statement; if a database access error occurs or this
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   404
    * method is called on a closed PreparedStatement
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   405
    * @exception SQLFeatureNotSupportedException if
21950
db3c826749f7 8029417: JDBC 4.2 javadoc updates
lancea
parents: 21278
diff changeset
   406
    * the JDBC driver does not support the specified targetSqlType
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
    * @see Types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
    void setObject(int parameterIndex, Object x, int targetSqlType)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
      throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * <p>Sets the value of the designated parameter using the given object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * <p>The JDBC specification specifies a standard mapping from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     * Java <code>Object</code> types to SQL types.  The given argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     * will be converted to the corresponding SQL type before being
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     * sent to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     *
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 23590
diff changeset
   420
     * <p>Note that this method may be used to pass database-
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * specific abstract data types, by using a driver-specific Java
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * If the object is of a class implementing the interface <code>SQLData</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * the JDBC driver should call the method <code>SQLData.writeSQL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * to write it to the SQL data stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * If, on the other hand, the object is of a class implementing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>,  <code>NClob</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     *  <code>Struct</code>, <code>java.net.URL</code>, <code>RowId</code>, <code>SQLXML</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * or <code>Array</code>, the driver should pass it to the database as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * value of the corresponding SQL type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     *<b>Note:</b> Not all databases allow for a non-typed Null to be sent to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * the backend. For maximum portability, the <code>setNull</code> or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     * <code>setObject(int parameterIndex, Object x, int sqlType)</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     * method should be used
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     * instead of <code>setObject(int parameterIndex, Object x)</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
     *<p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     * <b>Note:</b> This method throws an exception if there is an ambiguity, for example, if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * object is of a class implementing more than one of the interfaces named above.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     * @param x the object containing the input parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * marker in the SQL statement; if a database access error occurs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     *  this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * or the type of the given object is ambiguous
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
    void setObject(int parameterIndex, Object x) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     * Executes the SQL statement in this <code>PreparedStatement</code> object,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     * which may be any kind of SQL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     * Some prepared statements return multiple results; the <code>execute</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     * method handles these complex statements as well as the simpler
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * form of statements handled by the methods <code>executeQuery</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     * and <code>executeUpdate</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     * The <code>execute</code> method returns a <code>boolean</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     * indicate the form of the first result.  You must call either the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * <code>getResultSet</code> or <code>getUpdateCount</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     * to retrieve the result; you must call <code>getMoreResults</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * move to any subsequent result(s).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     * @return <code>true</code> if the first result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     *         object; <code>false</code> if the first result is an update
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     *         count or there is no result
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     * @exception SQLException if a database access error occurs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
     * or an argument is supplied to this method
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   471
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   472
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   473
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   474
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     * @see Statement#execute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
     * @see Statement#getResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
     * @see Statement#getUpdateCount
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     * @see Statement#getMoreResults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
    boolean execute() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
    //--------------------------JDBC 2.0-----------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
     * Adds a set of parameters to this <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
     * object's batch of commands.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     * @see Statement#addBatch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
    void addBatch() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     * Sets the designated parameter to the given <code>Reader</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * object, which is the given number of characters long.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     * <code>java.io.Reader</code> object. The data will be read from the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     * as needed until end-of-file is reached.  The JDBC driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     * do any necessary conversion from UNICODE to the database char format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     * @param reader the <code>java.io.Reader</code> object that contains the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     *        Unicode data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     * @param length the number of characters in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
    void setCharacterStream(int parameterIndex,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
                          java.io.Reader reader,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
                          int length) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     * Sets the designated parameter to the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     *  <code>REF(&lt;structured-type&gt;)</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     * The driver converts this to an SQL <code>REF</code> value when it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     * sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     * @param x an SQL <code>REF</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
    void setRef (int parameterIndex, Ref x) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     * Sets the designated parameter to the given <code>java.sql.Blob</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     * The driver converts this to an SQL <code>BLOB</code> value when it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
     * sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * @param x a <code>Blob</code> object that maps an SQL <code>BLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
    void setBlob (int parameterIndex, Blob x) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
     * Sets the designated parameter to the given <code>java.sql.Clob</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
     * The driver converts this to an SQL <code>CLOB</code> value when it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     * sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
     * @param x a <code>Clob</code> object that maps an SQL <code>CLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
    void setClob (int parameterIndex, Clob x) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     * Sets the designated parameter to the given <code>java.sql.Array</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     * The driver converts this to an SQL <code>ARRAY</code> value when it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
     * sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
     * @param x an <code>Array</code> object that maps an SQL <code>ARRAY</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
    void setArray (int parameterIndex, Array x) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
     * Retrieves a <code>ResultSetMetaData</code> object that contains
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     * information about the columns of the <code>ResultSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     * that will be returned when this <code>PreparedStatement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     * is executed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
     * Because a <code>PreparedStatement</code> object is precompiled, it is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
     * possible to know about the <code>ResultSet</code> object that it will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
     * return without having to execute it.  Consequently, it is possible
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
     * to invoke the method <code>getMetaData</code> on a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
     * <code>PreparedStatement</code> object rather than waiting to execute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     * it and then invoking the <code>ResultSet.getMetaData</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
     * on the <code>ResultSet</code> object that is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     * <B>NOTE:</B> Using this method may be expensive for some drivers due
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
     * to the lack of underlying DBMS support.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
     * @return the description of a <code>ResultSet</code> object's columns or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
     *         <code>null</code> if the driver cannot return a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
     *         <code>ResultSetMetaData</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
    ResultSetMetaData getMetaData() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
     * Sets the designated parameter to the given <code>java.sql.Date</code> value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
     * using the given <code>Calendar</code> object.  The driver uses
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
     * the <code>Calendar</code> object to construct an SQL <code>DATE</code> value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
     * which the driver then sends to the database.  With
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
     * a <code>Calendar</code> object, the driver can calculate the date
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
     * taking into account a custom timezone.  If no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
     * <code>Calendar</code> object is specified, the driver uses the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
     * timezone, which is that of the virtual machine running the application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
     * @param cal the <code>Calendar</code> object the driver will use
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
     *            to construct the date
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
    void setDate(int parameterIndex, java.sql.Date x, Calendar cal)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
            throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
     * Sets the designated parameter to the given <code>java.sql.Time</code> value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
     * using the given <code>Calendar</code> object.  The driver uses
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
     * the <code>Calendar</code> object to construct an SQL <code>TIME</code> value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
     * which the driver then sends to the database.  With
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
     * a <code>Calendar</code> object, the driver can calculate the time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
     * taking into account a custom timezone.  If no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
     * <code>Calendar</code> object is specified, the driver uses the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
     * timezone, which is that of the virtual machine running the application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
     * @param cal the <code>Calendar</code> object the driver will use
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
     *            to construct the time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
    void setTime(int parameterIndex, java.sql.Time x, Calendar cal)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
            throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
     * Sets the designated parameter to the given <code>java.sql.Timestamp</code> value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
     * using the given <code>Calendar</code> object.  The driver uses
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
     * the <code>Calendar</code> object to construct an SQL <code>TIMESTAMP</code> value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
     * which the driver then sends to the database.  With a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
     *  <code>Calendar</code> object, the driver can calculate the timestamp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
     * taking into account a custom timezone.  If no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
     * <code>Calendar</code> object is specified, the driver uses the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
     * timezone, which is that of the virtual machine running the application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
     * @param cal the <code>Calendar</code> object the driver will use
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
     *            to construct the timestamp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
    void setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar cal)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
            throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
     * Sets the designated parameter to SQL <code>NULL</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
     * This version of the method <code>setNull</code> should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
     * be used for user-defined types and REF type parameters.  Examples
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
     * of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
     * named array types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
     * <P><B>Note:</B> To be portable, applications must give the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
     * SQL type code and the fully-qualified SQL type name when specifying
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
     * a NULL user-defined or REF parameter.  In the case of a user-defined type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
     * the name is the type name of the parameter itself.  For a REF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
     * parameter, the name is the type name of the referenced type.  If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
     * a JDBC driver does not need the type code or type name information,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
     * it may ignore it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
     * Although it is intended for user-defined and Ref parameters,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
     * this method may be used to set a null parameter of any JDBC type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
     * If the parameter does not have a user-defined or REF type, the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
     * typeName is ignored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
     * @param sqlType a value from <code>java.sql.Types</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
     * @param typeName the fully-qualified name of an SQL user-defined type;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
     *  ignored if the parameter is not a user-defined type or REF
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
     * @exception SQLFeatureNotSupportedException if <code>sqlType</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
     * a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
     * <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
     * <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
     *  <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
     * or  <code>STRUCT</code> data type and the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
     * this data type or if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
  void setNull (int parameterIndex, int sqlType, String typeName)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
    throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
    //------------------------- JDBC 3.0 -----------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
     * Sets the designated parameter to the given <code>java.net.URL</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
     * The driver converts this to an SQL <code>DATALINK</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
     * when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
     * @param x the <code>java.net.URL</code> object to be set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
    void setURL(int parameterIndex, java.net.URL x) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
     * Retrieves the number, types and properties of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
     * <code>PreparedStatement</code> object's parameters.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
     * @return a <code>ParameterMetaData</code> object that contains information
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
     *         about the number, types and properties for each
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
     *  parameter marker of this <code>PreparedStatement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
     * @see ParameterMetaData
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
    ParameterMetaData getParameterMetaData() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
    //------------------------- JDBC 4.0 -----------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
     * Sets the designated parameter to the given <code>java.sql.RowId</code> object. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
     * driver converts this to a SQL <code>ROWID</code> value when it sends it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
     * to the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
     * @param x the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
     * @throws SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
    void setRowId(int parameterIndex, RowId x) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
    /**
11016
e2665f4ac6d2 7110111: Minor Java SE javadoc & Constructor clean up
lancea
parents: 6540
diff changeset
   768
     * Sets the designated parameter to the given <code>String</code> object.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
     * The driver converts this to a SQL <code>NCHAR</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
     * <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
     * (depending on the argument's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
     * size relative to the driver's limits on <code>NVARCHAR</code> values)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
     * when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
     * @param parameterIndex of the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
     * @param value the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
     * @throws SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
     * marker in the SQL statement; if the driver does not support national
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
     *         character sets;  if the driver can detect that a data conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
     *  error could occur; if a database access error occurs; or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
     void setNString(int parameterIndex, String value) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
     * Sets the designated parameter to a <code>Reader</code> object. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
     * <code>Reader</code> reads the data till end-of-file is reached. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
     * driver does the necessary conversion from Java character format to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
     * the national character set in the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
     * @param parameterIndex of the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
     * @param value the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
     * @param length the number of characters in the parameter data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
     * @throws SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
     * marker in the SQL statement; if the driver does not support national
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
     *         character sets;  if the driver can detect that a data conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
     *  error could occur; if a database access error occurs; or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
     void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
     * Sets the designated parameter to a <code>java.sql.NClob</code> object. The driver converts this to a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
     * SQL <code>NCLOB</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
     * @param parameterIndex of the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
     * @param value the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
     * @throws SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
     * marker in the SQL statement; if the driver does not support national
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
     *         character sets;  if the driver can detect that a data conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
     *  error could occur; if a database access error occurs; or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
     void setNClob(int parameterIndex, NClob value) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
90ce3da70b43 Initial load
duke
parents:
diff changeset
   820
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
     * Sets the designated parameter to a <code>Reader</code> object.  The reader must contain  the number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
     * of characters specified by length otherwise a <code>SQLException</code> will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
     * generated when the <code>PreparedStatement</code> is executed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
     *This method differs from the <code>setCharacterStream (int, Reader, int)</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
     * because it informs the driver that the parameter value should be sent to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
     * the server as a <code>CLOB</code>.  When the <code>setCharacterStream</code> method is used, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
     * driver may have to do extra work to determine whether the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
     * data should be sent to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
     * @param parameterIndex index of the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
     * @param reader An object that contains the data to set the parameter value to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
     * @param length the number of characters in the parameter data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
     * @throws SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
     * marker in the SQL statement; if a database access error occurs; this method is called on
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
     * a closed <code>PreparedStatement</code> or if the length specified is less than zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
     void setClob(int parameterIndex, Reader reader, long length)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
       throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
    /**
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 23590
diff changeset
   843
     * Sets the designated parameter to a <code>InputStream</code> object.
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 23590
diff changeset
   844
     * The {@code Inputstream} must contain  the number
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
     * of characters specified by length otherwise a <code>SQLException</code> will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
     * generated when the <code>PreparedStatement</code> is executed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
     * This method differs from the <code>setBinaryStream (int, InputStream, int)</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
     * method because it informs the driver that the parameter value should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
     * sent to the server as a <code>BLOB</code>.  When the <code>setBinaryStream</code> method is used,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
     * the driver may have to do extra work to determine whether the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
     * data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
     * @param parameterIndex index of the first parameter is 1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
     * the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
     * @param inputStream An object that contains the data to set the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
     * value to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
     * @param length the number of bytes in the parameter data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
     * @throws SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
     * marker in the SQL statement; if a database access error occurs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
     * this method is called on a closed <code>PreparedStatement</code>;
25976
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 23590
diff changeset
   860
     * if the length specified
4de01a56e3ee 8054555: javadoc cleanup for java.sql and javax.sql
lancea
parents: 23590
diff changeset
   861
     * is less than zero or if the number of bytes in the {@code InputStream} does not match
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 19849
diff changeset
   862
     * the specified length.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
     void setBlob(int parameterIndex, InputStream inputStream, long length)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
        throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
     * Sets the designated parameter to a <code>Reader</code> object.  The reader must contain  the number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
     * of characters specified by length otherwise a <code>SQLException</code> will be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
     * generated when the <code>PreparedStatement</code> is executed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
     * This method differs from the <code>setCharacterStream (int, Reader, int)</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
     * because it informs the driver that the parameter value should be sent to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
     * the server as a <code>NCLOB</code>.  When the <code>setCharacterStream</code> method is used, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
     * driver may have to do extra work to determine whether the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
     * data should be sent to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
     * @param parameterIndex index of the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
     * @param reader An object that contains the data to set the parameter value to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
     * @param length the number of characters in the parameter data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
     * @throws SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
     * marker in the SQL statement; if the length specified is less than zero;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
     * if the driver does not support national character sets;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
     * if the driver can detect that a data conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
     *  error could occur;  if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
     void setNClob(int parameterIndex, Reader reader, long length)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
       throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
      * Sets the designated parameter to the given <code>java.sql.SQLXML</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
      * The driver converts this to an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
      * SQL <code>XML</code> value when it sends it to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
      * @param parameterIndex index of the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
      * @param xmlObject a <code>SQLXML</code> object that maps an SQL <code>XML</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
      * @throws SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
     * marker in the SQL statement; if a database access error occurs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
      *  this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
      * or the <code>java.xml.transform.Result</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
      *  <code>Writer</code> or <code>OutputStream</code> has not been closed for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
      * the <code>SQLXML</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
      * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
      * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
     void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
    /**
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   914
     * <p>Sets the value of the designated parameter with the given object.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
     * If the second argument is an <code>InputStream</code> then the stream must contain
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
     * the number of bytes specified by scaleOrLength.  If the second argument is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
     * <code>Reader</code> then the reader must contain the number of characters specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
     * by scaleOrLength. If these conditions are not true the driver will generate a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
     * <code>SQLException</code> when the prepared statement is executed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
     * <p>The given Java object will be converted to the given targetSqlType
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
     * before being sent to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
     * If the object has a custom mapping (is of a class implementing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
     * interface <code>SQLData</code>),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
     * the JDBC driver should call the method <code>SQLData.writeSQL</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
     * write it to the SQL data stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
     * If, on the other hand, the object is of a class implementing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
     * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>,  <code>NClob</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
     *  <code>Struct</code>, <code>java.net.URL</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
     * or <code>Array</code>, the driver should pass it to the database as a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
     * value of the corresponding SQL type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
     * <p>Note that this method may be used to pass database-specific
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
     * abstract data types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
     * @param x the object containing the input parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
     * @param targetSqlType the SQL type (as defined in java.sql.Types) to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
     * sent to the database. The scale argument may further qualify this type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
     * @param scaleOrLength for <code>java.sql.Types.DECIMAL</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
     *          or <code>java.sql.Types.NUMERIC types</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
     *          this is the number of digits after the decimal point. For
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
     *          Java Object types <code>InputStream</code> and <code>Reader</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
     *          this is the length
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
     *          of the data in the stream or reader.  For all other types,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
     *          this value will be ignored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
     * marker in the SQL statement; if a database access error occurs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
     * this method is called on a closed <code>PreparedStatement</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
     *            if the Java Object specified by x is an InputStream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
     *            or Reader object and the value of the scale parameter is less
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
     *            than zero
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   955
     * @exception SQLFeatureNotSupportedException if
21950
db3c826749f7 8029417: JDBC 4.2 javadoc updates
lancea
parents: 21278
diff changeset
   956
     * the JDBC driver does not support the specified targetSqlType
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
     * @see Types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   959
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
    void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
            throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
     * Sets the designated parameter to the given input stream, which will have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   964
     * the specified number of bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   965
     * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   966
     * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
     * <code>java.io.InputStream</code>. Data will be read from the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
     * as needed until end-of-file is reached.  The JDBC driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
     * do any necessary conversion from ASCII to the database char format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
     * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
     * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
     * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
     * @param x the Java input stream that contains the ASCII parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
     * @param length the number of bytes in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
    void setAsciiStream(int parameterIndex, java.io.InputStream x, long length)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   984
            throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   986
     * Sets the designated parameter to the given input stream, which will have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
     * the specified number of bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
     * When a very large binary value is input to a <code>LONGVARBINARY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
     * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   990
     * <code>java.io.InputStream</code> object. The data will be read from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
     * stream as needed until end-of-file is reached.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
     * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
     * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
     * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
     * @param x the java input stream which contains the binary parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
     * @param length the number of bytes in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
    void setBinaryStream(int parameterIndex, java.io.InputStream x,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
                         long length) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
     * Sets the designated parameter to the given <code>Reader</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
     * object, which is the given number of characters long.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
     * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
     * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
     * <code>java.io.Reader</code> object. The data will be read from the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
     * as needed until end-of-file is reached.  The JDBC driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
     * do any necessary conversion from UNICODE to the database char format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
     * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
     * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
     * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
     * @param reader the <code>java.io.Reader</code> object that contains the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
     *        Unicode data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
     * @param length the number of characters in the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
    void setCharacterStream(int parameterIndex,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
                          java.io.Reader reader,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
                          long length) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
    //-----
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
     * Sets the designated parameter to the given input stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
     * When a very large ASCII value is input to a <code>LONGVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
     * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
     * <code>java.io.InputStream</code>. Data will be read from the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
     * as needed until end-of-file is reached.  The JDBC driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
     * do any necessary conversion from ASCII to the database char format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1040
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1041
     * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1042
     * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1043
     * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1044
     * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1045
     * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1046
     * <code>setAsciiStream</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1047
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1048
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1049
     * @param x the Java input stream that contains the ASCII parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1050
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1051
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1052
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1053
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1054
       * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1055
    */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1056
    void setAsciiStream(int parameterIndex, java.io.InputStream x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1057
            throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1058
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1059
     * Sets the designated parameter to the given input stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1060
     * When a very large binary value is input to a <code>LONGVARBINARY</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1061
     * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1062
     * <code>java.io.InputStream</code> object. The data will be read from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1063
     * stream as needed until end-of-file is reached.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1064
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1065
     * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1066
     * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1067
     * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1068
     * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1069
     * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1070
     * <code>setBinaryStream</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1071
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1072
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1073
     * @param x the java input stream which contains the binary parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1074
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1075
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1076
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1077
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1078
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1079
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1080
    void setBinaryStream(int parameterIndex, java.io.InputStream x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1081
    throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1082
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1083
     * Sets the designated parameter to the given <code>Reader</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1084
     * object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1085
     * When a very large UNICODE value is input to a <code>LONGVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1086
     * parameter, it may be more practical to send it via a
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1087
     * <code>java.io.Reader</code> object. The data will be read from the stream
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1088
     * as needed until end-of-file is reached.  The JDBC driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1089
     * do any necessary conversion from UNICODE to the database char format.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1090
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1091
     * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1092
     * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1093
     * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1094
     * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1095
     * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1096
     * <code>setCharacterStream</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1097
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1098
     * @param parameterIndex the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1099
     * @param reader the <code>java.io.Reader</code> object that contains the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1100
     *        Unicode data
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1101
     * @exception SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1102
     * marker in the SQL statement; if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1103
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1104
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1105
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1106
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1107
    void setCharacterStream(int parameterIndex,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1108
                          java.io.Reader reader) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1109
  /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1110
     * Sets the designated parameter to a <code>Reader</code> object. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1111
     * <code>Reader</code> reads the data till end-of-file is reached. The
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1112
     * driver does the necessary conversion from Java character format to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1113
     * the national character set in the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1114
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1115
     * <P><B>Note:</B> This stream object can either be a standard
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1116
     * Java stream object or your own subclass that implements the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1117
     * standard interface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1118
     * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1119
     * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1120
     * <code>setNCharacterStream</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1121
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1122
     * @param parameterIndex of the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1123
     * @param value the parameter value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1124
     * @throws SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1125
     * marker in the SQL statement; if the driver does not support national
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1126
     *         character sets;  if the driver can detect that a data conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1127
     *  error could occur; if a database access error occurs; or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1128
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1129
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1130
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1131
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1132
     void setNCharacterStream(int parameterIndex, Reader value) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1133
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1134
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1135
     * Sets the designated parameter to a <code>Reader</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1136
     * This method differs from the <code>setCharacterStream (int, Reader)</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1137
     * because it informs the driver that the parameter value should be sent to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1138
     * the server as a <code>CLOB</code>.  When the <code>setCharacterStream</code> method is used, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1139
     * driver may have to do extra work to determine whether the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1140
     * data should be sent to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1141
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1142
     * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1143
     * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1144
     * <code>setClob</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1145
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1146
     * @param parameterIndex index of the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1147
     * @param reader An object that contains the data to set the parameter value to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1148
     * @throws SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1149
     * marker in the SQL statement; if a database access error occurs; this method is called on
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1150
     * a closed <code>PreparedStatement</code>or if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1151
     * marker in the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1152
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1153
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1154
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1155
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1156
     void setClob(int parameterIndex, Reader reader)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1157
       throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1158
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1159
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1160
     * Sets the designated parameter to a <code>InputStream</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1161
     * This method differs from the <code>setBinaryStream (int, InputStream)</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1162
     * method because it informs the driver that the parameter value should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1163
     * sent to the server as a <code>BLOB</code>.  When the <code>setBinaryStream</code> method is used,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1164
     * the driver may have to do extra work to determine whether the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1165
     * data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1166
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1167
     * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1168
     * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1169
     * <code>setBlob</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1170
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1171
     * @param parameterIndex index of the first parameter is 1,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1172
     * the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1173
     * @param inputStream An object that contains the data to set the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1174
     * value to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1175
     * @throws SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1176
     * marker in the SQL statement; if a database access error occurs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1177
     * this method is called on a closed <code>PreparedStatement</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1178
     * if parameterIndex does not correspond
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1179
     * to a parameter marker in the SQL statement,
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1180
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1181
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1182
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1183
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1184
     void setBlob(int parameterIndex, InputStream inputStream)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1185
        throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1186
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1187
     * Sets the designated parameter to a <code>Reader</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1188
     * This method differs from the <code>setCharacterStream (int, Reader)</code> method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1189
     * because it informs the driver that the parameter value should be sent to
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1190
     * the server as a <code>NCLOB</code>.  When the <code>setCharacterStream</code> method is used, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1191
     * driver may have to do extra work to determine whether the parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1192
     * data should be sent to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1193
     * <P><B>Note:</B> Consult your JDBC driver documentation to determine if
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1194
     * it might be more efficient to use a version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1195
     * <code>setNClob</code> which takes a length parameter.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1196
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1197
     * @param parameterIndex index of the first parameter is 1, the second is 2, ...
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1198
     * @param reader An object that contains the data to set the parameter value to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1199
     * @throws SQLException if parameterIndex does not correspond to a parameter
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1200
     * marker in the SQL statement;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1201
     * if the driver does not support national character sets;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1202
     * if the driver can detect that a data conversion
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1203
     *  error could occur;  if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1204
     * this method is called on a closed <code>PreparedStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1205
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1206
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1207
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1208
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1209
     void setNClob(int parameterIndex, Reader reader)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1210
       throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1211
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1212
    //------------------------- JDBC 4.2 -----------------------------------
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1213
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1214
    /**
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1215
     * <p>Sets the value of the designated parameter with the given object.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1216
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1217
     * If the second argument is an {@code InputStream} then the stream
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1218
     * must contain the number of bytes specified by scaleOrLength.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1219
     * If the second argument is a {@code Reader} then the reader must
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1220
     * contain the number of characters specified by scaleOrLength. If these
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1221
     * conditions are not true the driver will generate a
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1222
     * {@code SQLException} when the prepared statement is executed.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1223
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1224
     * <p>The given Java object will be converted to the given targetSqlType
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1225
     * before being sent to the database.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1226
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1227
     * If the object has a custom mapping (is of a class implementing the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1228
     * interface {@code SQLData}),
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1229
     * the JDBC driver should call the method {@code SQLData.writeSQL} to
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1230
     * write it to the SQL data stream.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1231
     * If, on the other hand, the object is of a class implementing
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1232
     * {@code Ref}, {@code Blob}, {@code Clob},  {@code NClob},
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1233
     *  {@code Struct}, {@code java.net.URL},
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1234
     * or {@code Array}, the driver should pass it to the database as a
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1235
     * value of the corresponding SQL type.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1236
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1237
     * <p>Note that this method may be used to pass database-specific
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1238
     * abstract data types.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1239
     *<P>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1240
     * The default implementation will throw {@code SQLFeatureNotSupportedException}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1241
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1242
     * @param parameterIndex the first parameter is 1, the second is 2, ...
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1243
     * @param x the object containing the input parameter value
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1244
     * @param targetSqlType the SQL type to be sent to the database. The
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1245
     * scale argument may further qualify this type.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1246
     * @param scaleOrLength for {@code java.sql.JDBCType.DECIMAL}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1247
     *          or {@code java.sql.JDBCType.NUMERIC types},
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1248
     *          this is the number of digits after the decimal point. For
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1249
     *          Java Object types {@code InputStream} and {@code Reader},
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1250
     *          this is the length
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1251
     *          of the data in the stream or reader.  For all other types,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1252
     *          this value will be ignored.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1253
     * @exception SQLException if parameterIndex does not correspond to a
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1254
     * parameter marker in the SQL statement; if a database access error occurs
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1255
     * or this method is called on a closed {@code PreparedStatement}  or
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1256
     *            if the Java Object specified by x is an InputStream
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1257
     *            or Reader object and the value of the scale parameter is less
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1258
     *            than zero
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1259
     * @exception SQLFeatureNotSupportedException if
21950
db3c826749f7 8029417: JDBC 4.2 javadoc updates
lancea
parents: 21278
diff changeset
  1260
     * the JDBC driver does not support the specified targetSqlType
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1261
     * @see JDBCType
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1262
     * @see SQLType
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1263
     * @since 1.8
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1264
     */
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1265
    default void setObject(int parameterIndex, Object x, SQLType targetSqlType,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1266
             int scaleOrLength) throws SQLException {
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1267
        throw new SQLFeatureNotSupportedException("setObject not implemented");
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1268
    }
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1269
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1270
    /**
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1271
     * Sets the value of the designated parameter with the given object.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1272
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1273
     * This method is similar to {@link #setObject(int parameterIndex,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1274
     * Object x, SQLType targetSqlType, int scaleOrLength)},
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1275
     * except that it assumes a scale of zero.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1276
     *<P>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1277
     * The default implementation will throw {@code SQLFeatureNotSupportedException}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1278
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1279
     * @param parameterIndex the first parameter is 1, the second is 2, ...
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1280
     * @param x the object containing the input parameter value
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1281
     * @param targetSqlType the SQL type to be sent to the database
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1282
     * @exception SQLException if parameterIndex does not correspond to a
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1283
     * parameter marker in the SQL statement; if a database access error occurs
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1284
     * or this method is called on a closed {@code PreparedStatement}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1285
     * @exception SQLFeatureNotSupportedException if
21950
db3c826749f7 8029417: JDBC 4.2 javadoc updates
lancea
parents: 21278
diff changeset
  1286
     * the JDBC driver does not support the specified targetSqlType
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1287
     * @see JDBCType
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1288
     * @see SQLType
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1289
     * @since 1.8
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1290
     */
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1291
    default void setObject(int parameterIndex, Object x, SQLType targetSqlType)
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1292
      throws SQLException {
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1293
        throw new SQLFeatureNotSupportedException("setObject not implemented");
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1294
    }
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1295
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1296
    /**
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1297
     * Executes the SQL statement in this <code>PreparedStatement</code> object,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1298
     * which must be an SQL Data Manipulation Language (DML) statement,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1299
     * such as <code>INSERT</code>, <code>UPDATE</code> or
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1300
     * <code>DELETE</code>; or an SQL statement that returns nothing,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1301
     * such as a DDL statement.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1302
     * <p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1303
     * This method should be used when the returned row count may exceed
15284
aa4ba8514e3d 8006642: Fix javadoc warnings due to Integer.MAX_VALUE
lancea
parents: 15278
diff changeset
  1304
     * {@link Integer#MAX_VALUE}.
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1305
     * <p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1306
     * The default implementation will throw {@code UnsupportedOperationException}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1307
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1308
     * @return either (1) the row count for SQL Data Manipulation Language
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1309
     * (DML) statements or (2) 0 for SQL statements that return nothing
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1310
     * @exception SQLException if a database access error occurs;
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1311
     * this method is called on a closed  <code>PreparedStatement</code>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1312
     * or the SQL statement returns a <code>ResultSet</code> object
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1313
     * @throws SQLTimeoutException when the driver has determined that the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1314
     * timeout value that was specified by the {@code setQueryTimeout}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1315
     * method has been exceeded and has at least attempted to cancel
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1316
     * the currently running {@code Statement}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1317
     * @since 1.8
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1318
     */
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1319
    default long executeLargeUpdate() throws SQLException {
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1320
        throw new UnsupportedOperationException("executeLargeUpdate not implemented");
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1321
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1322
}