jdk/src/share/classes/java/sql/Statement.java
author alanb
Mon, 10 Jun 2013 12:58:32 +0100
changeset 18156 edb590d448c5
parent 15284 aa4ba8514e3d
child 20880 1b610151b316
permissions -rw-r--r--
8016217: More javadoc warnings Reviewed-by: lancea, chegar, psandoz
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
     2
 * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.sql;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * <P>The object used for executing a static SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * and returning the results it produces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * By default, only one <code>ResultSet</code> object per <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * object can be open at the same time. Therefore, if the reading of one
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * <code>ResultSet</code> object is interleaved
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * with the reading of another, each must have been generated by
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * different <code>Statement</code> objects. All execution methods in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * <code>Statement</code> interface implicitly close a statment's current
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * <code>ResultSet</code> object if an open one exists.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * @see Connection#createStatement
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * @see ResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 */
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    43
public interface Statement extends Wrapper, AutoCloseable {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
     * Executes the given SQL statement, which returns a single
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
     * <code>ResultSet</code> object.
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    48
     *<p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    49
     * <strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    50
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     * @param sql an SQL statement to be sent to the database, typically a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     *        static SQL <code>SELECT</code> statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     * @return a <code>ResultSet</code> object that contains the data produced
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     *         by the given query; never <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     * @exception SQLException if a database access error occurs,
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    56
     * this method is called on a closed <code>Statement</code>, the given
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     *            SQL statement produces anything other than a single
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    58
     *            <code>ResultSet</code> object, the method is called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    59
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    60
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    61
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    62
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    63
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    ResultSet executeQuery(String sql) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * Executes the given SQL statement, which may be an <code>INSERT</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * <code>UPDATE</code>, or <code>DELETE</code> statement or an
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * SQL statement that returns nothing, such as an SQL DDL statement.
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    71
     *<p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    72
     * <strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    73
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * @param sql an SQL Data Manipulation Language (DML) statement, such as <code>INSERT</code>, <code>UPDATE</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * <code>DELETE</code>; or an SQL statement that returns nothing,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * such as a DDL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * @return either (1) the row count for SQL Data Manipulation Language (DML) statements
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     *         or (2) 0 for SQL statements that return nothing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * @exception SQLException if a database access error occurs,
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    82
     * this method is called on a closed <code>Statement</code>, the given
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    83
     * SQL statement produces a <code>ResultSet</code> object, the method is called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    84
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    85
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    86
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    87
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
    88
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    int executeUpdate(String sql) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * Releases this <code>Statement</code> object's database
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * and JDBC resources immediately instead of waiting for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * this to happen when it is automatically closed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * It is generally good practice to release resources as soon as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * you are finished with them to avoid tying up database
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * resources.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * Calling the method <code>close</code> on a <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * object that is already closed has no effect.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * <B>Note:</B>When a <code>Statement</code> object is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * closed, its current <code>ResultSet</code> object, if one exists, is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * also closed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    void close() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    //----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * Retrieves the maximum number of bytes that can be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * returned for character and binary column values in a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * object produced by this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * This limit applies only to  <code>BINARY</code>, <code>VARBINARY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * <code>NCHAR</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * and <code>LONGVARCHAR</code> columns.  If the limit is exceeded, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * excess data is silently discarded.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * @return the current column size limit for columns storing character and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     *         binary values; zero means there is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * @see #setMaxFieldSize
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    int getMaxFieldSize() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * Sets the limit for the maximum number of bytes that can be returned for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * character and binary column values in a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * object produced by this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * This limit applies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * only to <code>BINARY</code>, <code>VARBINARY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * <code>NCHAR</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * <code>LONGVARCHAR</code> fields.  If the limit is exceeded, the excess data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * is silently discarded. For maximum portability, use values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * greater than 256.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * @param max the new column size limit in bytes; zero means there is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * this method is called on a closed <code>Statement</code>
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15284
diff changeset
   147
     *            or the condition {@code max >= 0} is not satisfied
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * @see #getMaxFieldSize
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    void setMaxFieldSize(int max) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * Retrieves the maximum number of rows that a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * <code>ResultSet</code> object produced by this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * <code>Statement</code> object can contain.  If this limit is exceeded,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * the excess rows are silently dropped.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * @return the current maximum number of rows for a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     *         object produced by this <code>Statement</code> object;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     *         zero means there is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * @see #setMaxRows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    int getMaxRows() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * Sets the limit for the maximum number of rows that any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * <code>ResultSet</code> object  generated by this <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * object can contain to the given number.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * If the limit is exceeded, the excess
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * rows are silently dropped.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * @param max the new max rows limit; zero means there is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * this method is called on a closed <code>Statement</code>
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15284
diff changeset
   177
     *            or the condition {@code max >= 0} is not satisfied
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * @see #getMaxRows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    void setMaxRows(int max) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * Sets escape processing on or off.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * If escape scanning is on (the default), the driver will do
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     * escape substitution before sending the SQL statement to the database.
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   186
     *<p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   187
     * The {@code Connection} and {@code DataSource} property
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   188
     * {@code escapeProcessing} may be used to change the default escape processing
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   189
     * behavior.  A value of true (the default) enables escape Processing for
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   190
     * all {@code Statement} objects. A value of false disables escape processing
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   191
     * for all {@code Statement} objects.  The {@code setEscapeProcessing}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   192
     * method may be used to specify the escape processing behavior for an
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   193
     * individual {@code Statement} object.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
   194
     * <p>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * Note: Since prepared statements have usually been parsed prior
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * to making this call, disabling escape processing for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * <code>PreparedStatements</code> objects will have no effect.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * @param enable <code>true</code> to enable escape processing;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     *       <code>false</code> to disable it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    void setEscapeProcessing(boolean enable) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * Retrieves the number of seconds the driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * wait for a <code>Statement</code> object to execute.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * If the limit is exceeded, a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * <code>SQLException</code> is thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * @return the current query timeout limit in seconds; zero means there is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     *         no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * @see #setQueryTimeout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    int getQueryTimeout() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * Sets the number of seconds the driver will wait for a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * <code>Statement</code> object to execute to the given number of seconds.
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   223
     *By default there is no limit on the amount of time allowed for a running
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   224
     * statement to complete. If the limit is exceeded, an
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   225
     * <code>SQLTimeoutException</code> is thrown.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   226
     * A JDBC driver must apply this limit to the <code>execute</code>,
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   227
     * <code>executeQuery</code> and <code>executeUpdate</code> methods.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   228
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   229
     * <strong>Note:</strong> JDBC driver implementations may also apply this
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   230
     * limit to {@code ResultSet} methods
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * (consult your driver vendor documentation for details).
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   232
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   233
     * <strong>Note:</strong> In the case of {@code Statement} batching, it is
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   234
     * implementation defined as to whether the time-out is applied to
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   235
     * individual SQL commands added via the {@code addBatch} method or to
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   236
     * the entire batch of SQL commands invoked by the {@code executeBatch}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   237
     * method (consult your driver vendor documentation for details).
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * @param seconds the new query timeout limit in seconds; zero means
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     *        there is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * this method is called on a closed <code>Statement</code>
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15284
diff changeset
   243
     *            or the condition {@code seconds >= 0} is not satisfied
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * @see #getQueryTimeout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    void setQueryTimeout(int seconds) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     * Cancels this <code>Statement</code> object if both the DBMS and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     * driver support aborting an SQL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * This method can be used by one thread to cancel a statement that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * is being executed by another thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    void cancel() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * Retrieves the first warning reported by calls on this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * Subsequent <code>Statement</code> object warnings will be chained to this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * <code>SQLWarning</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * <p>The warning chain is automatically cleared each time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * a statement is (re)executed. This method may not be called on a closed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * <code>Statement</code> object; doing so will cause an <code>SQLException</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * to be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * <P><B>Note:</B> If you are processing a <code>ResultSet</code> object, any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * warnings associated with reads on that <code>ResultSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * will be chained on it rather than on the <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     * object that produced it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     * @return the first <code>SQLWarning</code> object or <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     *         if there are no warnings
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    SQLWarning getWarnings() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * Clears all the warnings reported on this <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     * object. After a call to this method,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     * the method <code>getWarnings</code> will return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     * <code>null</code> until a new warning is reported for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    void clearWarnings() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * Sets the SQL cursor name to the given <code>String</code>, which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * will be used by subsequent <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     * <code>execute</code> methods. This name can then be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * used in SQL positioned update or delete statements to identify the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * current row in the <code>ResultSet</code> object generated by this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * statement.  If the database does not support positioned update/delete,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * this method is a noop.  To insure that a cursor has the proper isolation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     * level to support updates, the cursor's <code>SELECT</code> statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     * should have the form <code>SELECT FOR UPDATE</code>.  If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * <code>FOR UPDATE</code> is not present, positioned updates may fail.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     * <P><B>Note:</B> By definition, the execution of positioned updates and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * deletes must be done by a different <code>Statement</code> object than
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * the one that generated the <code>ResultSet</code> object being used for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     * positioning. Also, cursor names must be unique within a connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * @param name the new cursor name, which must be unique within
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     *             a connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
    void setCursorName(String name) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
    //----------------------- Multiple Results --------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * Executes the given SQL statement, which may return multiple results.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * In some (uncommon) situations, a single SQL statement may return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * multiple result sets and/or update counts.  Normally you can ignore
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     * this unless you are (1) executing a stored procedure that you know may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     * return multiple results or (2) you are dynamically executing an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * unknown SQL string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * The <code>execute</code> method executes an SQL statement and indicates the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * form of the first result.  You must then use the methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * <code>getResultSet</code> or <code>getUpdateCount</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * to retrieve the result, and <code>getMoreResults</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * move to any subsequent result(s).
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   335
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   336
     *<strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   337
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     * @param sql any SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     * @return <code>true</code> if the first result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     *         object; <code>false</code> if it is an update count or there are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     *         no results
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   342
     * @exception SQLException if a database access error occurs,
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   343
     * this method is called on a closed <code>Statement</code>,
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   344
     * the method is called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   345
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   346
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   347
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   348
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   349
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     * @see #getResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     * @see #getUpdateCount
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     * @see #getMoreResults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
    boolean execute(String sql) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     *  Retrieves the current result as a <code>ResultSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     *  This method should be called only once per result.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
     * @return the current result as a <code>ResultSet</code> object or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     * <code>null</code> if the result is an update count or there are no more results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * @see #execute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
    ResultSet getResultSet() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     *  Retrieves the current result as an update count;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     *  if the result is a <code>ResultSet</code> object or there are no more results, -1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     *  is returned. This method should be called only once per result.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     * @return the current result as an update count; -1 if the current result is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * <code>ResultSet</code> object or there are no more results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * @see #execute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
    int getUpdateCount() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     * Moves to this <code>Statement</code> object's next result, returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * <code>true</code> if it is a <code>ResultSet</code> object, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * implicitly closes any current <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * object(s) obtained with the method <code>getResultSet</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     * <P>There are no more results when the following is true:
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15284
diff changeset
   388
     * <PRE>{@code
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
     *     // stmt is a Statement object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
     *     ((stmt.getMoreResults() == false) && (stmt.getUpdateCount() == -1))
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15284
diff changeset
   391
     * }</PRE>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * @return <code>true</code> if the next result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     *         object; <code>false</code> if it is an update count or there are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     *         no more results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     * @see #execute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
    boolean getMoreResults() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
    //--------------------------JDBC 2.0-----------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     * Gives the driver a hint as to the direction in which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     * rows will be processed in <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     * objects created using this <code>Statement</code> object.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     * default value is <code>ResultSet.FETCH_FORWARD</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * Note that this method sets the default fetch direction for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * result sets generated by this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * Each result set has its own methods for getting and setting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * its own fetch direction.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     * @param direction the initial direction for processing rows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * or the given direction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * is not one of <code>ResultSet.FETCH_FORWARD</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * <code>ResultSet.FETCH_REVERSE</code>, or <code>ResultSet.FETCH_UNKNOWN</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * @see #getFetchDirection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
    void setFetchDirection(int direction) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     * Retrieves the direction for fetching rows from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * database tables that is the default for result sets
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * generated from this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     * If this <code>Statement</code> object has not set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * a fetch direction by calling the method <code>setFetchDirection</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * the return value is implementation-specific.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     * @return the default fetch direction for result sets generated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     *          from this <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     * @see #setFetchDirection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
    int getFetchDirection() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * Gives the JDBC driver a hint as to the number of rows that should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * be fetched from the database when more rows are needed for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     * <code>ResultSet</code> objects genrated by this <code>Statement</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     * If the value specified is zero, then the hint is ignored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     * The default value is zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     * @param rows the number of rows to fetch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     * this method is called on a closed <code>Statement</code> or the
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15284
diff changeset
   455
     *        condition {@code rows >= 0} is not satisfied.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     * @see #getFetchSize
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
    void setFetchSize(int rows) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     * Retrieves the number of result set rows that is the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * fetch size for <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * generated from this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     * If this <code>Statement</code> object has not set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     * a fetch size by calling the method <code>setFetchSize</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     * the return value is implementation-specific.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     * @return the default fetch size for result sets generated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
     *          from this <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * @see #setFetchSize
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
    int getFetchSize() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
     * Retrieves the result set concurrency for <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     * generated by this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
     * @return either <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     * <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
    int getResultSetConcurrency() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     * Retrieves the result set type for <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     * generated by this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     * @return one of <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
     * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
     * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
    int getResultSetType()  throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     * Adds the given SQL command to the current list of commmands for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     * <code>Statement</code> object. The commands in this list can be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     * executed as a batch by calling the method <code>executeBatch</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     * <P>
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   508
     *<strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   509
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     * @param sql typically this is a SQL <code>INSERT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     * <code>UPDATE</code> statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     * @exception SQLException if a database access error occurs,
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   513
     * this method is called on a closed <code>Statement</code>, the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   514
     * driver does not support batch updates, the method is called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   515
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
     * @see #executeBatch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     * @see DatabaseMetaData#supportsBatchUpdates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
    void addBatch( String sql ) 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
     * Empties this <code>Statement</code> object's current list of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     * SQL commands.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
     *  this method is called on a closed <code>Statement</code> or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     * driver does not support batch updates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     * @see #addBatch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     * @see DatabaseMetaData#supportsBatchUpdates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
    void clearBatch() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     * Submits a batch of commands to the database for execution and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     * if all commands execute successfully, returns an array of update counts.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
     * The <code>int</code> elements of the array that is returned are ordered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     * to correspond to the commands in the batch, which are ordered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     * according to the order in which they were added to the batch.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
     * The elements in the array returned by the method <code>executeBatch</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     * may be one of the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     * <OL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * <LI>A number greater than or equal to zero -- indicates that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     * command was processed successfully and is an update count giving the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     * number of rows in the database that were affected by the command's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     * execution
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     * <LI>A value of <code>SUCCESS_NO_INFO</code> -- indicates that the command was
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     * processed successfully but that the number of rows affected is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     * unknown
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
     * If one of the commands in a batch update fails to execute properly,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
     * this method throws a <code>BatchUpdateException</code>, and a JDBC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
     * driver may or may not continue to process the remaining commands in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
     * the batch.  However, the driver's behavior must be consistent with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     * particular DBMS, either always continuing to process commands or never
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     * continuing to process commands.  If the driver continues processing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     * after a failure, the array returned by the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
     * <code>BatchUpdateException.getUpdateCounts</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     * will contain as many elements as there are commands in the batch, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     * at least one of the elements will be the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
     * <LI>A value of <code>EXECUTE_FAILED</code> -- indicates that the command failed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
     * to execute successfully and occurs only if a driver continues to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
     * process commands after a command fails
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
     * </OL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     * The possible implementations and return values have been modified in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     * the Java 2 SDK, Standard Edition, version 1.3 to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     * accommodate the option of continuing to proccess commands in a batch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
     * update after a <code>BatchUpdateException</code> obejct has been thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
     * @return an array of update counts containing one element for each
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
     * command in the batch.  The elements of the array are ordered according
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
     * to the order in which commands were added to the batch.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     * this method is called on a closed <code>Statement</code> or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
     * driver does not support batch statements. Throws {@link BatchUpdateException}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
     * (a subclass of <code>SQLException</code>) if one of the commands sent to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
     * database fails to execute properly or attempts to return a result set.
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   581
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   582
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   583
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   584
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     * @see #addBatch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     * @see DatabaseMetaData#supportsBatchUpdates
7797
5869cf1fbd3e 7006454: Typo in javadocs typo for Statement.executeBatch @since
lancea
parents: 6684
diff changeset
   588
     * @since 1.2
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
    int[] executeBatch() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
     * Retrieves the <code>Connection</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     * that produced this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
     * @return the connection that produced this statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
    Connection getConnection()  throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
  //--------------------------JDBC 3.0-----------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
     * The constant indicating that the current <code>ResultSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
     * should be closed when calling <code>getMoreResults</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
    int CLOSE_CURRENT_RESULT = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
     * The constant indicating that the current <code>ResultSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
     * should not be closed when calling <code>getMoreResults</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
    int KEEP_CURRENT_RESULT = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
     * The constant indicating that all <code>ResultSet</code> objects that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
     * have previously been kept open should be closed when calling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
     * <code>getMoreResults</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
    int CLOSE_ALL_RESULTS = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
     * The constant indicating that a batch statement executed successfully
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
     * but that no count of the number of rows it affected is available.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
    int SUCCESS_NO_INFO = -2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
     * The constant indicating that an error occured while executing a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
     * batch statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
    int EXECUTE_FAILED = -3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
     * The constant indicating that generated keys should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
     * available for retrieval.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
    int RETURN_GENERATED_KEYS = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
     * The constant indicating that generated keys should not be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
     * available for retrieval.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
    int NO_GENERATED_KEYS = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
     * Moves to this <code>Statement</code> object's next result, deals with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
     * any current <code>ResultSet</code> object(s) according  to the instructions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
     * specified by the given flag, and returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
     * <code>true</code> if the next result is a <code>ResultSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
     * <P>There are no more results when the following is true:
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15284
diff changeset
   668
     * <PRE>{@code
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
     *     // stmt is a Statement object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
     *     ((stmt.getMoreResults(current) == false) && (stmt.getUpdateCount() == -1))
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15284
diff changeset
   671
     * }</PRE>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
     * @param current one of the following <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
     *        constants indicating what should happen to current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
     *        <code>ResultSet</code> objects obtained using the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
     *        <code>getResultSet</code>:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
     *        <code>Statement.CLOSE_CURRENT_RESULT</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
     *        <code>Statement.KEEP_CURRENT_RESULT</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
     *        <code>Statement.CLOSE_ALL_RESULTS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
     * @return <code>true</code> if the next result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
     *         object; <code>false</code> if it is an update count or there are no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
     *         more results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
     * this method is called on a closed <code>Statement</code> or the argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
         *         supplied is not one of the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
     *        <code>Statement.CLOSE_CURRENT_RESULT</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
     *        <code>Statement.KEEP_CURRENT_RESULT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
     *        <code>Statement.CLOSE_ALL_RESULTS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
     *@exception SQLFeatureNotSupportedException if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
     * <code>DatabaseMetaData.supportsMultipleOpenResults</code> returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
     * <code>false</code> and either
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
     *        <code>Statement.KEEP_CURRENT_RESULT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
     *        <code>Statement.CLOSE_ALL_RESULTS</code> are supplied as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
     * the argument.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
     * @see #execute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
    boolean getMoreResults(int current) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
     * Retrieves any auto-generated keys created as a result of executing this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
     * <code>Statement</code> object. If this <code>Statement</code> object did
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
     * not generate any keys, an empty <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
     * object is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
     *<p><B>Note:</B>If the columns which represent the auto-generated keys were not specified,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
     * the JDBC driver implementation will determine the columns which best represent the auto-generated keys.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
     * @return a <code>ResultSet</code> object containing the auto-generated key(s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
     *         generated by the execution of this <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
    ResultSet getGeneratedKeys() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
     * Executes the given SQL statement and signals the driver with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
     * given flag about whether the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
     * auto-generated keys produced by this <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
     * should be made available for retrieval.  The driver will ignore the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
     * flag if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
     * auto-generated keys (the list of such statements is vendor-specific).
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   726
     *<p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   727
     * <strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   728
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
     * @param sql an SQL Data Manipulation Language (DML) statement, such as <code>INSERT</code>, <code>UPDATE</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
     * <code>DELETE</code>; or an SQL statement that returns nothing,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
     * such as a DDL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
     * @param autoGeneratedKeys a flag indicating whether auto-generated keys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
     *        should be made available for retrieval;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
     *         one of the following constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
     *         <code>Statement.RETURN_GENERATED_KEYS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
     *         <code>Statement.NO_GENERATED_KEYS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
     * @return either (1) the row count for SQL Data Manipulation Language (DML) statements
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
     *         or (2) 0 for SQL statements that return nothing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   742
     *  this method is called on a closed <code>Statement</code>, the given
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   743
     *            SQL statement returns a <code>ResultSet</code> object,
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   744
     *            the given constant is not one of those allowed, the method is called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   745
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
     * this method with a constant of Statement.RETURN_GENERATED_KEYS
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   748
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   749
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   750
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   751
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
    int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
     * Executes the given SQL statement and signals the driver that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
     * auto-generated keys indicated in the given array should be made available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
     * for retrieval.   This array contains the indexes of the columns in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
     * target table that contain the auto-generated keys that should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
     * available. The driver will ignore the array if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
     * auto-generated keys (the list of such statements is vendor-specific).
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   764
     *<p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   765
     * <strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   766
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
     * @param sql an SQL Data Manipulation Language (DML) statement, such as <code>INSERT</code>, <code>UPDATE</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
     * <code>DELETE</code>; or an SQL statement that returns nothing,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
     * such as a DDL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
     * @param columnIndexes an array of column indexes indicating the columns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
     *        that should be returned from the inserted row
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
     * @return either (1) the row count for SQL Data Manipulation Language (DML) statements
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
     *         or (2) 0 for SQL statements that return nothing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
     * this method is called on a closed <code>Statement</code>, the SQL
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   778
     * statement returns a <code>ResultSet</code> object,the second argument
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   779
     * supplied to this method is not an
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   780
     * <code>int</code> array whose elements are valid column indexes, the method is called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   781
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   783
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   784
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   785
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   786
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
    int executeUpdate(String sql, int columnIndexes[]) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
     * Executes the given SQL statement and signals the driver that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
     * auto-generated keys indicated in the given array should be made available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
     * for retrieval.   This array contains the names of the columns in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
     * target table that contain the auto-generated keys that should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
     * available. The driver will ignore the array if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
     * auto-generated keys (the list of such statements is vendor-specific).
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   799
     *<p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   800
     * <strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   801
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
     * @param sql an SQL Data Manipulation Language (DML) statement, such as <code>INSERT</code>, <code>UPDATE</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
     * <code>DELETE</code>; or an SQL statement that returns nothing,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
     * such as a DDL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
     * @param columnNames an array of the names of the columns that should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
     *        returned from the inserted row
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
     * @return either the row count for <code>INSERT</code>, <code>UPDATE</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
     *         or <code>DELETE</code> statements, or 0 for SQL statements
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
     *         that return nothing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
     *  this method is called on a closed <code>Statement</code>, the SQL
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   812
     *            statement returns a <code>ResultSet</code> object, the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
     *            second argument supplied to this method is not a <code>String</code> array
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   814
     *            whose elements are valid column names, the method is called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   815
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   817
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   818
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   819
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   820
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
    int executeUpdate(String sql, String columnNames[]) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
     * Executes the given SQL statement, which may return multiple results,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
     * and signals the driver that any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
     * auto-generated keys should be made available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
     * for retrieval.  The driver will ignore this signal if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
     * In some (uncommon) situations, a single SQL statement may return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
     * multiple result sets and/or update counts.  Normally you can ignore
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
     * this unless you are (1) executing a stored procedure that you know may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
     * return multiple results or (2) you are dynamically executing an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
     * unknown SQL string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
     * The <code>execute</code> method executes an SQL statement and indicates the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
     * form of the first result.  You must then use the methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
     * <code>getResultSet</code> or <code>getUpdateCount</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
     * to retrieve the result, and <code>getMoreResults</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
     * move to any subsequent result(s).
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   844
     *<p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   845
     *<strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   846
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
     * @param sql any SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
     * @param autoGeneratedKeys a constant indicating whether auto-generated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
     *        keys should be made available for retrieval using the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
     *        <code>getGeneratedKeys</code>; one of the following constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
     *        <code>Statement.RETURN_GENERATED_KEYS</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
     *        <code>Statement.NO_GENERATED_KEYS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
     * @return <code>true</code> if the first result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
     *         object; <code>false</code> if it is an update count or there are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
     *         no results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
     * @exception SQLException if a database access error occurs,
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   857
     * this method is called on a closed <code>Statement</code>, the second
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
     *         parameter supplied to this method is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
     *         <code>Statement.RETURN_GENERATED_KEYS</code> or
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   860
     *         <code>Statement.NO_GENERATED_KEYS</code>,
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   861
     * the method is called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   862
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
     * this method with a constant of Statement.RETURN_GENERATED_KEYS
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   865
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   866
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   867
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   868
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
     * @see #getResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
     * @see #getUpdateCount
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
     * @see #getMoreResults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
     * @see #getGeneratedKeys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
    boolean execute(String sql, int autoGeneratedKeys) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
     * Executes the given SQL statement, which may return multiple results,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
     * and signals the driver that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
     * auto-generated keys indicated in the given array should be made available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
     * for retrieval.  This array contains the indexes of the columns in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
     * target table that contain the auto-generated keys that should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
     * available.  The driver will ignore the array if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
     * Under some (uncommon) situations, a single SQL statement may return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
     * multiple result sets and/or update counts.  Normally you can ignore
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
     * this unless you are (1) executing a stored procedure that you know may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
     * return multiple results or (2) you are dynamically executing an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
     * unknown SQL string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
     * The <code>execute</code> method executes an SQL statement and indicates the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
     * form of the first result.  You must then use the methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
     * <code>getResultSet</code> or <code>getUpdateCount</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
     * to retrieve the result, and <code>getMoreResults</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
     * move to any subsequent result(s).
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   899
     *<p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   900
     * <strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   901
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
     * @param sql any SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
     * @param columnIndexes an array of the indexes of the columns in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
     *        inserted row that should be  made available for retrieval by a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   905
     *        call to the method <code>getGeneratedKeys</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
     * @return <code>true</code> if the first result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
     *         object; <code>false</code> if it is an update count or there
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
     *         are no results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
     * @exception SQLException if a database access error occurs,
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   910
     * this method is called on a closed <code>Statement</code>, the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
     *            elements in the <code>int</code> array passed to this method
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   912
     *            are not valid column indexes, the method is called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   913
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   915
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   916
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   917
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   918
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
     * @see #getResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
     * @see #getUpdateCount
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
     * @see #getMoreResults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
    boolean execute(String sql, int columnIndexes[]) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
     * Executes the given SQL statement, which may return multiple results,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
     * and signals the driver that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
     * auto-generated keys indicated in the given array should be made available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
     * for retrieval. This array contains the names of the columns in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
     * target table that contain the auto-generated keys that should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
     * available.  The driver will ignore the array if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
     * In some (uncommon) situations, a single SQL statement may return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
     * multiple result sets and/or update counts.  Normally you can ignore
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
     * this unless you are (1) executing a stored procedure that you know may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
     * return multiple results or (2) you are dynamically executing an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
     * unknown SQL string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
     * The <code>execute</code> method executes an SQL statement and indicates the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
     * form of the first result.  You must then use the methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
     * <code>getResultSet</code> or <code>getUpdateCount</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
     * to retrieve the result, and <code>getMoreResults</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
     * move to any subsequent result(s).
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   948
     *<p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   949
     * <strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   950
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
     * @param sql any SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
     * @param columnNames an array of the names of the columns in the inserted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
     *        row that should be made available for retrieval by a call to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
     *        method <code>getGeneratedKeys</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
     * @return <code>true</code> if the next result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   956
     *         object; <code>false</code> if it is an update count or there
90ce3da70b43 Initial load
duke
parents:
diff changeset
   957
     *         are no more results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   958
     * @exception SQLException if a database access error occurs,
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   959
     * this method is called on a closed <code>Statement</code>,the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
     *          elements of the <code>String</code> array passed to this
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   961
     *          method are not valid column names, the method is called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   962
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   964
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   965
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   966
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   967
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
     * @see #getResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
     * @see #getUpdateCount
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
     * @see #getMoreResults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
     * @see #getGeneratedKeys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
    boolean execute(String sql, String columnNames[]) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
     * Retrieves the result set holdability for <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
     * generated by this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
     * @return either <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
     *         <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   984
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   986
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
    int getResultSetHoldability() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
90ce3da70b43 Initial load
duke
parents:
diff changeset
   990
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
     * Retrieves whether this <code>Statement</code> object has been closed. A <code>Statement</code> is closed if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
     * method close has been called on it, or if it is automatically closed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
     * @return true if this <code>Statement</code> object is closed; false if it is still open
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
     * @throws SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
    boolean isClosed() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
         * Requests that a <code>Statement</code> be pooled or not pooled.  The value
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
         * specified is a hint to the statement pool implementation indicating
11016
e2665f4ac6d2 7110111: Minor Java SE javadoc & Constructor clean up
lancea
parents: 7797
diff changeset
  1002
         * whether the application wants the statement to be pooled.  It is up to
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
         * the statement pool manager as to whether the hint is used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
         * The poolable value of a statement is applicable to both internal
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
         * statement caches implemented by the driver and external statement caches
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
         * implemented by application servers and other applications.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
         * By default, a <code>Statement</code> is not poolable when created, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
         * a <code>PreparedStatement</code> and <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
         * are poolable when created.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
         * @param poolable              requests that the statement be pooled if true and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
         *                                              that the statement not be pooled if false
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
         * @throws SQLException if this method is called on a closed
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
         * <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
         * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
        void setPoolable(boolean poolable)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
                throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
         * Returns a  value indicating whether the <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
         * is poolable or not.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
         * @return              <code>true</code> if the <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
         * is poolable; <code>false</code> otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
         * @throws SQLException if this method is called on a closed
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
         * <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1033
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1034
         * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1035
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1036
         * @see java.sql.Statement#setPoolable(boolean) setPoolable(boolean)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1037
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1038
        boolean isPoolable()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1039
                throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1040
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1041
    //--------------------------JDBC 4.1 -----------------------------
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1042
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1043
    /**
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1044
     * Specifies that this {@code Statement} will be closed when all its
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1045
     * dependent result sets are closed. If execution of the {@code Statement}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1046
     * does not produce any result sets, this method has no effect.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1047
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1048
     * <strong>Note:</strong> Multiple calls to {@code closeOnCompletion} do
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1049
     * not toggle the effect on this {@code Statement}. However, a call to
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1050
     * {@code closeOnCompletion} does effect both the subsequent execution of
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1051
     * statements, and statements that currently have open, dependent,
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1052
     * result sets.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1053
     *
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1054
     * @throws SQLException if this method is called on a closed
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1055
     * {@code Statement}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1056
     * @since 1.7
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1057
     */
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1058
    public void closeOnCompletion() throws SQLException;
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1059
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1060
    /**
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1061
     * Returns a value indicating whether this {@code Statement} will be
6684
2708e0ba15a8 6987638: javadoc update to RowSetProvider and Statement
lancea
parents: 6540
diff changeset
  1062
     * closed when all its dependent result sets are closed.
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1063
     * @return {@code true} if the {@code Statement} will be closed when all
6684
2708e0ba15a8 6987638: javadoc update to RowSetProvider and Statement
lancea
parents: 6540
diff changeset
  1064
     * of its dependent result sets are closed; {@code false} otherwise
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1065
     * @throws SQLException if this method is called on a closed
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1066
     * {@code Statement}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1067
     * @since 1.7
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1068
     */
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1069
    public boolean isCloseOnCompletion() throws SQLException;
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1070
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1071
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1072
    //--------------------------JDBC 4.2 -----------------------------
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1073
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1074
    /**
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1075
     *  Retrieves the current result as an update count; if the result
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1076
     * is a <code>ResultSet</code> object or there are no more results, -1
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1077
     *  is returned. This method should be called only once per result.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1078
     * <p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1079
     * 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
  1080
     * {@link Integer#MAX_VALUE}.
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1081
     *<p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1082
     * The default implementation will throw {@code UnsupportedOperationException}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1083
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1084
     * @return the current result as an update count; -1 if the current result
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1085
     * is a <code>ResultSet</code> object or there are no more results
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1086
     * @exception SQLException if a database access error occurs or
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1087
     * this method is called on a closed <code>Statement</code>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1088
     * @see #execute
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1089
     * @since 1.8
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1090
     */
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1091
    default long getLargeUpdateCount() throws SQLException {
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1092
        throw new UnsupportedOperationException("getLargeUpdateCount not implemented");
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1093
    }
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1094
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1095
    /**
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1096
     * Sets the limit for the maximum number of rows that any
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1097
     * <code>ResultSet</code> object  generated by this <code>Statement</code>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1098
     * object can contain to the given number.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1099
     * If the limit is exceeded, the excess
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1100
     * rows are silently dropped.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1101
     * <p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1102
     * This method should be used when the row limit may exceed
15284
aa4ba8514e3d 8006642: Fix javadoc warnings due to Integer.MAX_VALUE
lancea
parents: 15278
diff changeset
  1103
     * {@link Integer#MAX_VALUE}.
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1104
     *<p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1105
     * The default implementation will throw {@code UnsupportedOperationException}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1106
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1107
     * @param max the new max rows limit; zero means there is no limit
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1108
     * @exception SQLException if a database access error occurs,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1109
     * this method is called on a closed <code>Statement</code>
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 15284
diff changeset
  1110
     *            or the condition {@code max >= 0} is not satisfied
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1111
     * @see #getMaxRows
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1112
     * @since 1.8
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1113
     */
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1114
    default void setLargeMaxRows(long max) throws SQLException {
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1115
        throw new UnsupportedOperationException("setLargeMaxRows not implemented");
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1116
    }
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1117
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1118
    /**
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1119
     * Retrieves the maximum number of rows that a
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1120
     * <code>ResultSet</code> object produced by this
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1121
     * <code>Statement</code> object can contain.  If this limit is exceeded,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1122
     * the excess rows are silently dropped.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1123
     * <p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1124
     * This method should be used when the returned row limit may exceed
15284
aa4ba8514e3d 8006642: Fix javadoc warnings due to Integer.MAX_VALUE
lancea
parents: 15278
diff changeset
  1125
     * {@link Integer#MAX_VALUE}.
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1126
     *<p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1127
     * The default implementation will return {@code 0}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1128
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1129
     * @return the current maximum number of rows for a <code>ResultSet</code>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1130
     *         object produced by this <code>Statement</code> object;
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1131
     *         zero means there is no limit
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1132
     * @exception SQLException if a database access error occurs or
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1133
     * this method is called on a closed <code>Statement</code>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1134
     * @see #setMaxRows
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1135
     * @since 1.8
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1136
     */
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1137
    default long getLargeMaxRows() throws SQLException {
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1138
        return 0;
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1139
    }
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1140
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1141
    /**
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1142
     * Submits a batch of commands to the database for execution and
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1143
     * if all commands execute successfully, returns an array of update counts.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1144
     * The <code>long</code> elements of the array that is returned are ordered
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1145
     * to correspond to the commands in the batch, which are ordered
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1146
     * according to the order in which they were added to the batch.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1147
     * The elements in the array returned by the method {@code executeLargeBatch}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1148
     * may be one of the following:
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1149
     * <OL>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1150
     * <LI>A number greater than or equal to zero -- indicates that the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1151
     * command was processed successfully and is an update count giving the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1152
     * number of rows in the database that were affected by the command's
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1153
     * execution
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1154
     * <LI>A value of <code>SUCCESS_NO_INFO</code> -- indicates that the command was
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1155
     * processed successfully but that the number of rows affected is
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1156
     * unknown
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1157
     * <P>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1158
     * If one of the commands in a batch update fails to execute properly,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1159
     * this method throws a <code>BatchUpdateException</code>, and a JDBC
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1160
     * driver may or may not continue to process the remaining commands in
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1161
     * the batch.  However, the driver's behavior must be consistent with a
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1162
     * particular DBMS, either always continuing to process commands or never
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1163
     * continuing to process commands.  If the driver continues processing
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1164
     * after a failure, the array returned by the method
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1165
     * <code>BatchUpdateException.getLargeUpdateCounts</code>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1166
     * will contain as many elements as there are commands in the batch, and
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1167
     * at least one of the elements will be the following:
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1168
     * <P>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1169
     * <LI>A value of <code>EXECUTE_FAILED</code> -- indicates that the command failed
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1170
     * to execute successfully and occurs only if a driver continues to
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1171
     * process commands after a command fails
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1172
     * </OL>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1173
     * <p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1174
     * 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
  1175
     * {@link Integer#MAX_VALUE}.
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1176
     *<p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1177
     * The default implementation will throw {@code UnsupportedOperationException}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1178
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1179
     * @return an array of update counts containing one element for each
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1180
     * command in the batch.  The elements of the array are ordered according
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1181
     * to the order in which commands were added to the batch.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1182
     * @exception SQLException if a database access error occurs,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1183
     * this method is called on a closed <code>Statement</code> or the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1184
     * driver does not support batch statements. Throws {@link BatchUpdateException}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1185
     * (a subclass of <code>SQLException</code>) if one of the commands sent to the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1186
     * database fails to execute properly or attempts to return a result set.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1187
     * @throws SQLTimeoutException when the driver has determined that the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1188
     * timeout value that was specified by the {@code setQueryTimeout}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1189
     * method has been exceeded and has at least attempted to cancel
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1190
     * the currently running {@code Statement}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1191
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1192
     * @see #addBatch
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1193
     * @see DatabaseMetaData#supportsBatchUpdates
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1194
     * @since 1.8
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1195
     */
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1196
    default long[] executeLargeBatch() throws SQLException {
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1197
        throw new UnsupportedOperationException("executeLargeBatch not implemented");
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1198
    }
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1199
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1200
    /**
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1201
     * Executes the given SQL statement, which may be an <code>INSERT</code>,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1202
     * <code>UPDATE</code>, or <code>DELETE</code> statement or an
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1203
     * SQL statement that returns nothing, such as an SQL DDL statement.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1204
     * <p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1205
     * 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
  1206
     * {@link Integer#MAX_VALUE}.
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1207
     * <p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1208
     * <strong>Note:</strong>This method cannot be called on a
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1209
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1210
     *<p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1211
     * The default implementation will throw {@code UnsupportedOperationException}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1212
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1213
     * @param sql an SQL Data Manipulation Language (DML) statement,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1214
     * such as <code>INSERT</code>, <code>UPDATE</code> or
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1215
     * <code>DELETE</code>; or an SQL statement that returns nothing,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1216
     * such as a DDL statement.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1217
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1218
     * @return either (1) the row count for SQL Data Manipulation Language
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1219
     * (DML) statements or (2) 0 for SQL statements that return nothing
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1220
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1221
     * @exception SQLException if a database access error occurs,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1222
     * this method is called on a closed <code>Statement</code>, the given
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1223
     * SQL statement produces a <code>ResultSet</code> object, the method is called on a
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1224
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1225
     * @throws SQLTimeoutException when the driver has determined that the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1226
     * timeout value that was specified by the {@code setQueryTimeout}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1227
     * method has been exceeded and has at least attempted to cancel
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1228
     * the currently running {@code Statement}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1229
     * @since 1.8
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1230
     */
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1231
    default long executeLargeUpdate(String sql) throws SQLException {
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1232
        throw new UnsupportedOperationException("executeLargeUpdate not implemented");
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1233
    }
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1234
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1235
    /**
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1236
     * Executes the given SQL statement and signals the driver with the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1237
     * given flag about whether the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1238
     * auto-generated keys produced by this <code>Statement</code> object
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1239
     * should be made available for retrieval.  The driver will ignore the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1240
     * flag if the SQL statement
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1241
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1242
     * auto-generated keys (the list of such statements is vendor-specific).
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1243
     * <p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1244
     * 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
  1245
     * {@link Integer#MAX_VALUE}.
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1246
     * <p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1247
     * <strong>Note:</strong>This method cannot be called on a
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1248
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1249
     *<p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1250
     * The default implementation will throw {@code SQLFeatureNotSupportedException}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1251
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1252
     * @param sql an SQL Data Manipulation Language (DML) statement,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1253
     * such as <code>INSERT</code>, <code>UPDATE</code> or
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1254
     * <code>DELETE</code>; or an SQL statement that returns nothing,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1255
     * such as a DDL statement.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1256
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1257
     * @param autoGeneratedKeys a flag indicating whether auto-generated keys
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1258
     *        should be made available for retrieval;
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1259
     *         one of the following constants:
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1260
     *         <code>Statement.RETURN_GENERATED_KEYS</code>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1261
     *         <code>Statement.NO_GENERATED_KEYS</code>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1262
     * @return either (1) the row count for SQL Data Manipulation Language (DML) statements
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1263
     *         or (2) 0 for SQL statements that return nothing
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
     * @exception SQLException if a database access error occurs,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1266
     *  this method is called on a closed <code>Statement</code>, the given
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1267
     *            SQL statement returns a <code>ResultSet</code> object,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1268
     *            the given constant is not one of those allowed, the method is called on a
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1269
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1270
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1271
     * this method with a constant of Statement.RETURN_GENERATED_KEYS
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1272
     * @throws SQLTimeoutException when the driver has determined that the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1273
     * timeout value that was specified by the {@code setQueryTimeout}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1274
     * method has been exceeded and has at least attempted to cancel
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1275
     * the currently running {@code Statement}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1276
     * @since 1.8
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1277
     */
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1278
    default long executeLargeUpdate(String sql, int autoGeneratedKeys)
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1279
            throws SQLException {
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1280
        throw new SQLFeatureNotSupportedException("executeLargeUpdate not implemented");
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1281
    }
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1282
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1283
    /**
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1284
     * Executes the given SQL statement and signals the driver that the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1285
     * auto-generated keys indicated in the given array should be made available
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1286
     * for retrieval.   This array contains the indexes of the columns in the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1287
     * target table that contain the auto-generated keys that should be made
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1288
     * available. The driver will ignore the array if the SQL statement
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1289
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1290
     * auto-generated keys (the list of such statements is vendor-specific).
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1291
     * <p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1292
     * 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
  1293
     * {@link Integer#MAX_VALUE}.
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1294
     * <p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1295
     * <strong>Note:</strong>This method cannot be called on a
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1296
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1297
     *<p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1298
     * The default implementation will throw {@code SQLFeatureNotSupportedException}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1299
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1300
     * @param sql an SQL Data Manipulation Language (DML) statement,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1301
     * such as <code>INSERT</code>, <code>UPDATE</code> or
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1302
     * <code>DELETE</code>; or an SQL statement that returns nothing,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1303
     * such as a DDL statement.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1304
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1305
     * @param columnIndexes an array of column indexes indicating the columns
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1306
     *        that should be returned from the inserted row
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1307
     * @return either (1) the row count for SQL Data Manipulation Language (DML) statements
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1308
     *         or (2) 0 for SQL statements that return nothing
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1309
     *
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>Statement</code>, the SQL
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1312
     * statement returns a <code>ResultSet</code> object,the second argument
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1313
     * supplied to this method is not an
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1314
     * <code>int</code> array whose elements are valid column indexes, the method is called on a
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1315
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1316
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1317
     * @throws SQLTimeoutException when the driver has determined that the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1318
     * timeout value that was specified by the {@code setQueryTimeout}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1319
     * method has been exceeded and has at least attempted to cancel
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1320
     * the currently running {@code Statement}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1321
     * @since 1.8
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1322
     */
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1323
    default long executeLargeUpdate(String sql, int columnIndexes[]) throws SQLException {
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1324
        throw new SQLFeatureNotSupportedException("executeLargeUpdate not implemented");
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1325
    }
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1326
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1327
    /**
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1328
     * Executes the given SQL statement and signals the driver that the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1329
     * auto-generated keys indicated in the given array should be made available
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1330
     * for retrieval.   This array contains the names of the columns in the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1331
     * target table that contain the auto-generated keys that should be made
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1332
     * available. The driver will ignore the array if the SQL statement
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1333
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1334
     * auto-generated keys (the list of such statements is vendor-specific).
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1335
     * <p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1336
     * 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
  1337
     * {@link Integer#MAX_VALUE}.
15278
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1338
     * <p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1339
     * <strong>Note:</strong>This method cannot be called on a
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1340
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1341
     *<p>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1342
     * The default implementation will throw {@code SQLFeatureNotSupportedException}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1343
     *
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1344
     * @param sql an SQL Data Manipulation Language (DML) statement,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1345
     * such as <code>INSERT</code>, <code>UPDATE</code> or
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1346
     * <code>DELETE</code>; or an SQL statement that returns nothing,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1347
     * such as a DDL statement.
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1348
     * @param columnNames an array of the names of the columns that should be
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1349
     *        returned from the inserted row
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1350
     * @return either the row count for <code>INSERT</code>, <code>UPDATE</code>,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1351
     *         or <code>DELETE</code> statements, or 0 for SQL statements
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1352
     *         that return nothing
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1353
     * @exception SQLException if a database access error occurs,
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1354
     *  this method is called on a closed <code>Statement</code>, the SQL
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1355
     *            statement returns a <code>ResultSet</code> object, the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1356
     *            second argument supplied to this method is not a <code>String</code> array
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1357
     *            whose elements are valid column names, the method is called on a
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1358
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1359
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1360
     * @throws SQLTimeoutException when the driver has determined that the
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1361
     * timeout value that was specified by the {@code setQueryTimeout}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1362
     * method has been exceeded and has at least attempted to cancel
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1363
     * the currently running {@code Statement}
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1364
     * @since 1.8
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1365
     */
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1366
    default long executeLargeUpdate(String sql, String columnNames[])
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1367
            throws SQLException {
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1368
        throw new SQLFeatureNotSupportedException("executeLargeUpdate not implemented");
e081d3f73b75 8005080: JDBC 4.2 Core changes
lancea
parents: 14342
diff changeset
  1369
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1370
}