jdk/src/share/classes/java/sql/Statement.java
author lancea
Fri, 10 Sep 2010 15:26:04 -0400
changeset 6540 a4ae668f6125
parent 5506 202f599c92aa
child 6684 2708e0ba15a8
permissions -rw-r--r--
6589685: JDBC 4.1 updates Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
     2
 * Copyright (c) 1996, 2010, 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>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     *            or the condition max >= 0 is not satisfied
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>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     *            or the condition max >= 0 is not satisfied
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.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * Note: Since prepared statements have usually been parsed prior
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * to making this call, disabling escape processing for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * <code>PreparedStatements</code> objects will have no effect.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * @param enable <code>true</code> to enable escape processing;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     *       <code>false</code> to disable it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    void setEscapeProcessing(boolean enable) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * Retrieves the number of seconds the driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * wait for a <code>Statement</code> object to execute.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * If the limit is exceeded, a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * <code>SQLException</code> is thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * @return the current query timeout limit in seconds; zero means there is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     *         no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * @see #setQueryTimeout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    int getQueryTimeout() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * Sets the number of seconds the driver will wait for a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * <code>Statement</code> object to execute to the given number of seconds.
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   215
     *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
   216
     * statement to complete. If the limit is exceeded, an
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   217
     * <code>SQLTimeoutException</code> is thrown.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   218
     * A JDBC driver must apply this limit to the <code>execute</code>,
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   219
     * <code>executeQuery</code> and <code>executeUpdate</code> methods.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   220
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   221
     * <strong>Note:</strong> JDBC driver implementations may also apply this
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   222
     * limit to {@code ResultSet} methods
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * (consult your driver vendor documentation for details).
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   224
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   225
     * <strong>Note:</strong> In the case of {@code Statement} batching, it is
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   226
     * implementation defined as to whether the time-out is applied to
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   227
     * individual SQL commands added via the {@code addBatch} method or to
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   228
     * the entire batch of SQL commands invoked by the {@code executeBatch}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   229
     * method (consult your driver vendor documentation for details).
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * @param seconds the new query timeout limit in seconds; zero means
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     *        there is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     *            or the condition seconds >= 0 is not satisfied
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * @see #getQueryTimeout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    void setQueryTimeout(int seconds) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * Cancels this <code>Statement</code> object if both the DBMS and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * driver support aborting an SQL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * This method can be used by one thread to cancel a statement that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * is being executed by another thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    void cancel() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * Retrieves the first warning reported by calls on this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * Subsequent <code>Statement</code> object warnings will be chained to this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * <code>SQLWarning</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * <p>The warning chain is automatically cleared each time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * a statement is (re)executed. This method may not be called on a closed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * <code>Statement</code> object; doing so will cause an <code>SQLException</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * to be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * <P><B>Note:</B> If you are processing a <code>ResultSet</code> object, any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * warnings associated with reads on that <code>ResultSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * will be chained on it rather than on the <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * object that produced it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * @return the first <code>SQLWarning</code> object or <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     *         if there are no warnings
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
    SQLWarning getWarnings() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     * Clears all the warnings reported on this <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     * object. After a call to this method,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     * the method <code>getWarnings</code> will return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     * <code>null</code> until a new warning is reported for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
    void clearWarnings() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     * Sets the SQL cursor name to the given <code>String</code>, which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     * will be used by subsequent <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * <code>execute</code> methods. This name can then be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * used in SQL positioned update or delete statements to identify the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * current row in the <code>ResultSet</code> object generated by this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * statement.  If the database does not support positioned update/delete,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * this method is a noop.  To insure that a cursor has the proper isolation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * level to support updates, the cursor's <code>SELECT</code> statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * should have the form <code>SELECT FOR UPDATE</code>.  If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * <code>FOR UPDATE</code> is not present, positioned updates may fail.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * <P><B>Note:</B> By definition, the execution of positioned updates and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * deletes must be done by a different <code>Statement</code> object than
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * the one that generated the <code>ResultSet</code> object being used for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * positioning. Also, cursor names must be unique within a connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     * @param name the new cursor name, which must be unique within
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     *             a connection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
    void setCursorName(String name) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
    //----------------------- Multiple Results --------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     * Executes the given SQL statement, which may return multiple results.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     * In some (uncommon) situations, a single SQL statement may return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     * multiple result sets and/or update counts.  Normally you can ignore
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     * this unless you are (1) executing a stored procedure that you know may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     * return multiple results or (2) you are dynamically executing an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     * unknown SQL string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * The <code>execute</code> method executes an SQL statement and indicates the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * form of the first result.  You must then use the methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * <code>getResultSet</code> or <code>getUpdateCount</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * to retrieve the result, and <code>getMoreResults</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     * move to any subsequent result(s).
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   327
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   328
     *<strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   329
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * @param sql any SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * @return <code>true</code> if the first result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     *         object; <code>false</code> if it is an update count or there are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     *         no results
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   334
     * @exception SQLException if a database access error occurs,
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   335
     * this method is called on a closed <code>Statement</code>,
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   336
     * the method is called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   337
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   338
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   339
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   340
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   341
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * @see #getResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     * @see #getUpdateCount
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     * @see #getMoreResults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
    boolean execute(String sql) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     *  Retrieves the current result as a <code>ResultSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     *  This method should be called only once per result.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     * @return the current result as a <code>ResultSet</code> object or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * <code>null</code> if the result is an update count or there are no more results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     * @see #execute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
    ResultSet getResultSet() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
     *  Retrieves the current result as an update count;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     *  if the result is a <code>ResultSet</code> object or there are no more results, -1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
     *  is returned. This method should be called only once per result.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * @return the current result as an update count; -1 if the current result is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * <code>ResultSet</code> object or there are no more results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     * @see #execute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
    int getUpdateCount() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * Moves to this <code>Statement</code> object's next result, returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * <code>true</code> if it is a <code>ResultSet</code> object, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     * implicitly closes any current <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * object(s) obtained with the method <code>getResultSet</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     * <P>There are no more results when the following is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     *     // stmt is a Statement object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     *     ((stmt.getMoreResults() == false) && (stmt.getUpdateCount() == -1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     * @return <code>true</code> if the next result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
     *         object; <code>false</code> if it is an update count or there are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
     *         no more results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
     * @see #execute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    boolean getMoreResults() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
    //--------------------------JDBC 2.0-----------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     * Gives the driver a hint as to the direction in which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     * rows will be processed in <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * objects created using this <code>Statement</code> object.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     * default value is <code>ResultSet.FETCH_FORWARD</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
     * Note that this method sets the default fetch direction for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     * result sets generated by this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     * Each result set has its own methods for getting and setting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     * its own fetch direction.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     * @param direction the initial direction for processing rows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * or the given direction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * is not one of <code>ResultSet.FETCH_FORWARD</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * <code>ResultSet.FETCH_REVERSE</code>, or <code>ResultSet.FETCH_UNKNOWN</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     * @see #getFetchDirection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
    void setFetchDirection(int direction) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * Retrieves the direction for fetching rows from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * database tables that is the default for result sets
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * generated from this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * If this <code>Statement</code> object has not set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * a fetch direction by calling the method <code>setFetchDirection</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * the return value is implementation-specific.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * @return the default fetch direction for result sets generated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     *          from this <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * @see #setFetchDirection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
    int getFetchDirection() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
     * Gives the JDBC driver a hint as to the number of rows that should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     * be fetched from the database when more rows are needed for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * <code>ResultSet</code> objects genrated by this <code>Statement</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     * If the value specified is zero, then the hint is ignored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     * The default value is zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * @param rows the number of rows to fetch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * this method is called on a closed <code>Statement</code> or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     *        condition  <code>rows >= 0</code> is not satisfied.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     * @see #getFetchSize
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
    void setFetchSize(int rows) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     * Retrieves the number of result set rows that is the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     * fetch size for <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * generated from this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     * If this <code>Statement</code> object has not set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * a fetch size by calling the method <code>setFetchSize</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     * the return value is implementation-specific.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * @return the default fetch size for result sets generated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     *          from this <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     * @see #setFetchSize
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
    int getFetchSize() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
     * Retrieves the result set concurrency for <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     * generated by this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * @return either <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     * <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
    int getResultSetConcurrency() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     * Retrieves the result set type for <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
     * generated by this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
     * @return one of <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
     * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
    int getResultSetType()  throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
     * Adds the given SQL command to the current list of commmands for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     * <code>Statement</code> object. The commands in this list can be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * executed as a batch by calling the method <code>executeBatch</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * <P>
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   500
     *<strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   501
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     * @param sql typically this is a SQL <code>INSERT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     * <code>UPDATE</code> statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     * @exception SQLException if a database access error occurs,
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   505
     * this method is called on a closed <code>Statement</code>, the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   506
     * driver does not support batch updates, the method is called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   507
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
     * @see #executeBatch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     * @see DatabaseMetaData#supportsBatchUpdates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
    void addBatch( String sql ) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     * Empties this <code>Statement</code> object's current list of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
     * SQL commands.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     *  this method is called on a closed <code>Statement</code> or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * driver does not support batch updates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     * @see #addBatch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     * @see DatabaseMetaData#supportsBatchUpdates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
    void clearBatch() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     * Submits a batch of commands to the database for execution and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     * if all commands execute successfully, returns an array of update counts.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     * The <code>int</code> elements of the array that is returned are ordered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     * to correspond to the commands in the batch, which are ordered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     * according to the order in which they were added to the batch.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     * The elements in the array returned by the method <code>executeBatch</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
     * may be one of the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     * <OL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     * <LI>A number greater than or equal to zero -- indicates that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     * command was processed successfully and is an update count giving the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
     * number of rows in the database that were affected by the command's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     * execution
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     * <LI>A value of <code>SUCCESS_NO_INFO</code> -- indicates that the command was
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
     * processed successfully but that the number of rows affected is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     * unknown
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * If one of the commands in a batch update fails to execute properly,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     * this method throws a <code>BatchUpdateException</code>, and a JDBC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     * driver may or may not continue to process the remaining commands in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     * the batch.  However, the driver's behavior must be consistent with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     * particular DBMS, either always continuing to process commands or never
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     * continuing to process commands.  If the driver continues processing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     * after a failure, the array returned by the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
     * <code>BatchUpdateException.getUpdateCounts</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
     * will contain as many elements as there are commands in the batch, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
     * at least one of the elements will be the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
     * <LI>A value of <code>EXECUTE_FAILED</code> -- indicates that the command failed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     * to execute successfully and occurs only if a driver continues to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     * process commands after a command fails
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
     * </OL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     * The possible implementations and return values have been modified in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     * the Java 2 SDK, Standard Edition, version 1.3 to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     * accommodate the option of continuing to proccess commands in a batch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
     * update after a <code>BatchUpdateException</code> obejct has been thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
     * @return an array of update counts containing one element for each
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
     * command in the batch.  The elements of the array are ordered according
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
     * to the order in which commands were added to the batch.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     * this method is called on a closed <code>Statement</code> or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     * driver does not support batch statements. Throws {@link BatchUpdateException}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
     * (a subclass of <code>SQLException</code>) if one of the commands sent to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     * database fails to execute properly or attempts to return a result set.
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   573
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   574
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   575
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   576
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
     * @see #addBatch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
     * @see DatabaseMetaData#supportsBatchUpdates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
    int[] executeBatch() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     * Retrieves the <code>Connection</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     * that produced this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     * @return the connection that produced this statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
    Connection getConnection()  throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
  //--------------------------JDBC 3.0-----------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     * The constant indicating that the current <code>ResultSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
     * should be closed when calling <code>getMoreResults</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
    int CLOSE_CURRENT_RESULT = 1;
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 not 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 KEEP_CURRENT_RESULT = 2;
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 all <code>ResultSet</code> objects that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
     * have previously been kept open should be closed when calling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
     * <code>getMoreResults</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
    int CLOSE_ALL_RESULTS = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
     * The constant indicating that a batch statement executed successfully
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
     * but that no count of the number of rows it affected is available.
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 SUCCESS_NO_INFO = -2;
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 an error occured while executing a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
     * batch statement.
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 EXECUTE_FAILED = -3;
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 generated keys should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
     * available for retrieval.
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 RETURN_GENERATED_KEYS = 1;
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 not 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 NO_GENERATED_KEYS = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
     * Moves to this <code>Statement</code> object's next result, deals with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
     * any current <code>ResultSet</code> object(s) according  to the instructions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
     * specified by the given flag, and returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
     * <code>true</code> if the next result is a <code>ResultSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
     * <P>There are no more results when the following is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
     * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
     *     // stmt is a Statement object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
     *     ((stmt.getMoreResults(current) == false) && (stmt.getUpdateCount() == -1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
     * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
     * @param current one of the following <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
     *        constants indicating what should happen to current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
     *        <code>ResultSet</code> objects obtained using the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
     *        <code>getResultSet</code>:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
     *        <code>Statement.CLOSE_CURRENT_RESULT</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
     *        <code>Statement.KEEP_CURRENT_RESULT</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
     *        <code>Statement.CLOSE_ALL_RESULTS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
     * @return <code>true</code> if the next result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
     *         object; <code>false</code> if it is an update count or there are no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
     *         more results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
     * this method is called on a closed <code>Statement</code> or the argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
         *         supplied is not one of the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
     *        <code>Statement.CLOSE_CURRENT_RESULT</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
     *        <code>Statement.KEEP_CURRENT_RESULT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
     *        <code>Statement.CLOSE_ALL_RESULTS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
     *@exception SQLFeatureNotSupportedException if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
     * <code>DatabaseMetaData.supportsMultipleOpenResults</code> returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
     * <code>false</code> and either
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
     *        <code>Statement.KEEP_CURRENT_RESULT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
     *        <code>Statement.CLOSE_ALL_RESULTS</code> are supplied as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
     * the argument.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
     * @see #execute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
    boolean getMoreResults(int current) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
     * Retrieves any auto-generated keys created as a result of executing this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
     * <code>Statement</code> object. If this <code>Statement</code> object did
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
     * not generate any keys, an empty <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
     * object is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
     *<p><B>Note:</B>If the columns which represent the auto-generated keys were not specified,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
     * the JDBC driver implementation will determine the columns which best represent the auto-generated keys.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
     * @return a <code>ResultSet</code> object containing the auto-generated key(s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
     *         generated by the execution of this <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
    ResultSet getGeneratedKeys() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
     * Executes the given SQL statement and signals the driver with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
     * given flag about whether the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
     * auto-generated keys produced by this <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
     * should be made available for retrieval.  The driver will ignore the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
     * flag if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
     * auto-generated keys (the list of such statements is vendor-specific).
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   718
     *<p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   719
     * <strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   720
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
     * @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
   722
     * <code>DELETE</code>; or an SQL statement that returns nothing,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
     * such as a DDL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
     * @param autoGeneratedKeys a flag indicating whether auto-generated keys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
     *        should be made available for retrieval;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
     *         one of the following constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
     *         <code>Statement.RETURN_GENERATED_KEYS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
     *         <code>Statement.NO_GENERATED_KEYS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
     * @return either (1) the row count for SQL Data Manipulation Language (DML) statements
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
     *         or (2) 0 for SQL statements that return nothing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
     *  this method is called on a closed <code>Statement</code>, the given
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   735
     *            SQL statement returns a <code>ResultSet</code> object,
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   736
     *            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
   737
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
     * this method with a constant of Statement.RETURN_GENERATED_KEYS
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   740
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   741
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   742
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   743
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
    int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
     * Executes the given SQL statement and signals the driver that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
     * auto-generated keys indicated in the given array should be made available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
     * for retrieval.   This array contains the indexes of the columns in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
     * target table that contain the auto-generated keys that should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
     * available. The driver will ignore the array if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
     * auto-generated keys (the list of such statements is vendor-specific).
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   756
     *<p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   757
     * <strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   758
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
     * @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
   760
     * <code>DELETE</code>; or an SQL statement that returns nothing,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
     * such as a DDL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
     * @param columnIndexes an array of column indexes indicating the columns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
     *        that should be returned from the inserted row
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
     * @return either (1) the row count for SQL Data Manipulation Language (DML) statements
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
     *         or (2) 0 for SQL statements that return nothing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
     * this method is called on a closed <code>Statement</code>, the SQL
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   770
     * statement returns a <code>ResultSet</code> object,the second argument
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   771
     * supplied to this method is not an
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   772
     * <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
   773
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   775
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   776
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   777
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   778
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
    int executeUpdate(String sql, int columnIndexes[]) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
     * Executes the given SQL statement and signals the driver that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
     * auto-generated keys indicated in the given array should be made available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
     * for retrieval.   This array contains the names of the columns in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
     * target table that contain the auto-generated keys that should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
     * available. The driver will ignore the array if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
     * auto-generated keys (the list of such statements is vendor-specific).
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   791
     *<p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   792
     * <strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   793
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
     * @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
   795
     * <code>DELETE</code>; or an SQL statement that returns nothing,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
     * such as a DDL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
     * @param columnNames an array of the names of the columns that should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
     *        returned from the inserted row
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
     * @return either the row count for <code>INSERT</code>, <code>UPDATE</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
     *         or <code>DELETE</code> statements, or 0 for SQL statements
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
     *         that return nothing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
     *  this method is called on a closed <code>Statement</code>, the SQL
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   804
     *            statement returns a <code>ResultSet</code> object, the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
     *            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
   806
     *            whose elements are valid column names, the method is called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   807
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   809
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   810
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   811
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   812
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
    int executeUpdate(String sql, String columnNames[]) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
     * Executes the given SQL statement, which may return multiple results,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
     * and signals the driver that any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   820
     * auto-generated keys should be made available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
     * for retrieval.  The driver will ignore this signal if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
     * In some (uncommon) situations, a single SQL statement may return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
     * multiple result sets and/or update counts.  Normally you can ignore
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
     * this unless you are (1) executing a stored procedure that you know may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
     * return multiple results or (2) you are dynamically executing an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
     * unknown SQL string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
     * The <code>execute</code> method executes an SQL statement and indicates the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
     * form of the first result.  You must then use the methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
     * <code>getResultSet</code> or <code>getUpdateCount</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
     * to retrieve the result, and <code>getMoreResults</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
     * move to any subsequent result(s).
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   836
     *<p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   837
     *<strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   838
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
     * @param sql any SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
     * @param autoGeneratedKeys a constant indicating whether auto-generated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
     *        keys should be made available for retrieval using the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
     *        <code>getGeneratedKeys</code>; one of the following constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
     *        <code>Statement.RETURN_GENERATED_KEYS</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
     *        <code>Statement.NO_GENERATED_KEYS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
     * @return <code>true</code> if the first result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
     *         object; <code>false</code> if it is an update count or there are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
     *         no results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
     * @exception SQLException if a database access error occurs,
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   849
     * this method is called on a closed <code>Statement</code>, the second
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
     *         parameter supplied to this method is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
     *         <code>Statement.RETURN_GENERATED_KEYS</code> or
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   852
     *         <code>Statement.NO_GENERATED_KEYS</code>,
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   853
     * the method is called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   854
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
     * this method with a constant of Statement.RETURN_GENERATED_KEYS
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   857
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   858
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   859
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   860
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
     * @see #getResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
     * @see #getUpdateCount
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
     * @see #getMoreResults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
     * @see #getGeneratedKeys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
    boolean execute(String sql, int autoGeneratedKeys) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
     * Executes the given SQL statement, which may return multiple results,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
     * and signals the driver that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
     * auto-generated keys indicated in the given array should be made available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
     * for retrieval.  This array contains the indexes of the columns in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
     * target table that contain the auto-generated keys that should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
     * available.  The driver will ignore the array if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
     * Under some (uncommon) situations, a single SQL statement may return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
     * multiple result sets and/or update counts.  Normally you can ignore
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
     * this unless you are (1) executing a stored procedure that you know may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
     * return multiple results or (2) you are dynamically executing an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
     * unknown SQL string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
     * The <code>execute</code> method executes an SQL statement and indicates the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
     * form of the first result.  You must then use the methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
     * <code>getResultSet</code> or <code>getUpdateCount</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
     * to retrieve the result, and <code>getMoreResults</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
     * move to any subsequent result(s).
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   891
     *<p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   892
     * <strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   893
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
     * @param sql any SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
     * @param columnIndexes an array of the indexes of the columns in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
     *        inserted row that should be  made available for retrieval by a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
     *        call to the method <code>getGeneratedKeys</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
     * @return <code>true</code> if the first result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
     *         object; <code>false</code> if it is an update count or there
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
     *         are no results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
     * @exception SQLException if a database access error occurs,
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   902
     * this method is called on a closed <code>Statement</code>, the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
     *            elements in the <code>int</code> array passed to this method
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   904
     *            are not valid column indexes, the method is called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   905
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   907
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   908
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   909
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   910
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
     * @see #getResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
     * @see #getUpdateCount
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
     * @see #getMoreResults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
    boolean execute(String sql, int columnIndexes[]) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
     * Executes the given SQL statement, which may return multiple results,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
     * and signals the driver that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
     * auto-generated keys indicated in the given array should be made available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
     * for retrieval. This array contains the names of the columns in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
     * target table that contain the auto-generated keys that should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
     * available.  The driver will ignore the array if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
     * In some (uncommon) situations, a single SQL statement may return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
     * multiple result sets and/or update counts.  Normally you can ignore
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
     * this unless you are (1) executing a stored procedure that you know may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
     * return multiple results or (2) you are dynamically executing an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
     * unknown SQL string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
     * The <code>execute</code> method executes an SQL statement and indicates the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
     * form of the first result.  You must then use the methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
     * <code>getResultSet</code> or <code>getUpdateCount</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
     * to retrieve the result, and <code>getMoreResults</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
     * move to any subsequent result(s).
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   940
     *<p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   941
     * <strong>Note:</strong>This method cannot be called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   942
     * <code>PreparedStatement</code> or <code>CallableStatement</code>.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
     * @param sql any SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
     * @param columnNames an array of the names of the columns in the inserted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
     *        row that should be made available for retrieval by a call to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
     *        method <code>getGeneratedKeys</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
     * @return <code>true</code> if the next result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
     *         object; <code>false</code> if it is an update count or there
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
     *         are no more results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
     * @exception SQLException if a database access error occurs,
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   951
     * this method is called on a closed <code>Statement</code>,the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
     *          elements of the <code>String</code> array passed to this
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   953
     *          method are not valid column names, the method is called on a
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   954
     * <code>PreparedStatement</code> or <code>CallableStatement</code>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   955
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   956
     * @throws SQLTimeoutException when the driver has determined that the
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   957
     * timeout value that was specified by the {@code setQueryTimeout}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   958
     * method has been exceeded and has at least attempted to cancel
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
   959
     * the currently running {@code Statement}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   960
     * @see #getResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   961
     * @see #getUpdateCount
90ce3da70b43 Initial load
duke
parents:
diff changeset
   962
     * @see #getMoreResults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   963
     * @see #getGeneratedKeys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   964
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   965
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   966
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   967
    boolean execute(String sql, String columnNames[]) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   968
90ce3da70b43 Initial load
duke
parents:
diff changeset
   969
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   970
     * Retrieves the result set holdability for <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   971
     * generated by this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   972
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   973
     * @return either <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   974
     *         <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   975
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   976
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   977
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   978
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   979
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   980
    int getResultSetHoldability() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   981
90ce3da70b43 Initial load
duke
parents:
diff changeset
   982
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   983
     * 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
   984
     * method close has been called on it, or if it is automatically closed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   985
     * @return true if this <code>Statement</code> object is closed; false if it is still open
90ce3da70b43 Initial load
duke
parents:
diff changeset
   986
     * @throws SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   987
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   988
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   989
    boolean isClosed() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   990
90ce3da70b43 Initial load
duke
parents:
diff changeset
   991
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   992
         * Requests that a <code>Statement</code> be pooled or not pooled.  The value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   993
         * specified is a hint to the statement pool implementation indicating
90ce3da70b43 Initial load
duke
parents:
diff changeset
   994
         * whether the applicaiton wants the statement to be pooled.  It is up to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   995
         * the statement pool manager as to whether the hint is used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   996
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   997
         * The poolable value of a statement is applicable to both internal
90ce3da70b43 Initial load
duke
parents:
diff changeset
   998
         * statement caches implemented by the driver and external statement caches
90ce3da70b43 Initial load
duke
parents:
diff changeset
   999
         * implemented by application servers and other applications.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1000
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1001
         * By default, a <code>Statement</code> is not poolable when created, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1002
         * a <code>PreparedStatement</code> and <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1003
         * are poolable when created.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1004
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1005
         * @param poolable              requests that the statement be pooled if true and
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1006
         *                                              that the statement not be pooled if false
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1007
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1008
         * @throws SQLException if this method is called on a closed
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1009
         * <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1010
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1011
         * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1012
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1013
        void setPoolable(boolean poolable)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1014
                throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1015
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1016
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1017
         * Returns a  value indicating whether the <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1018
         * is poolable or not.
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1019
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1020
         * @return              <code>true</code> if the <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1021
         * is poolable; <code>false</code> otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1022
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1023
         * @throws SQLException if this method is called on a closed
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1024
         * <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1025
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1026
         * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1027
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1028
         * @see java.sql.Statement#setPoolable(boolean) setPoolable(boolean)
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1029
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1030
        boolean isPoolable()
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1031
                throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1032
6540
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1033
    //--------------------------JDBC 4.1 -----------------------------
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1034
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1035
    /**
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1036
     * Specifies that this {@code Statement} will be closed when all its
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1037
     * dependent result sets are closed. If execution of the {@code Statement}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1038
     * does not produce any result sets, this method has no effect.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1039
     * <p>
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1040
     * <strong>Note:</strong> Multiple calls to {@code closeOnCompletion} do
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1041
     * not toggle the effect on this {@code Statement}. However, a call to
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1042
     * {@code closeOnCompletion} does effect both the subsequent execution of
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1043
     * statements, and statements that currently have open, dependent,
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1044
     * result sets.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1045
     *
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1046
     * @throws SQLException if this method is called on a closed
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1047
     * {@code Statement}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1048
     * @since 1.7
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1049
     */
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1050
    public void closeOnCompletion() throws SQLException;
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1051
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1052
    /**
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1053
     * Returns a value indicating whether this {@code Statement} will be
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1054
     * closed when all dependent objects such as resultsets are closed.
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1055
     * @return {@code true} if the {@code Statement} will be closed when all
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1056
     * of its dependent objects are closed; {@code false} otherwise
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1057
     * @throws SQLException if this method is called on a closed
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1058
     * {@code Statement}
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1059
     * @since 1.7
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1060
     */
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1061
    public boolean isCloseOnCompletion() throws SQLException;
a4ae668f6125 6589685: JDBC 4.1 updates
lancea
parents: 5506
diff changeset
  1062
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
  1063
}