jdk/src/share/classes/java/sql/Statement.java
author chegar
Tue, 12 May 2009 16:32:34 +0100
changeset 3450 2f08a8bb9b83
parent 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
6801071: Remote sites can compromise user privacy and possibly hijack web sessions Reviewed-by: jccollet, hawtin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1996-2006 Sun Microsystems, Inc.  All Rights Reserved.
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
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
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
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
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
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
public interface Statement extends Wrapper {
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.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
     * @param sql an SQL statement to be sent to the database, typically a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
     *        static SQL <code>SELECT</code> statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     * @return a <code>ResultSet</code> object that contains the data produced
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     *         by the given query; never <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     * this method is called on a closed <code>Statement</code> or the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     *            SQL statement produces anything other than a single
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     *            <code>ResultSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    ResultSet executeQuery(String sql) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     * Executes the given SQL statement, which may be an <code>INSERT</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * <code>UPDATE</code>, or <code>DELETE</code> statement or an
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * SQL statement that returns nothing, such as an SQL DDL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * @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
    66
     * <code>DELETE</code>; or an SQL statement that returns nothing,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * such as a DDL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * @return either (1) the row count for SQL Data Manipulation Language (DML) statements
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     *         or (2) 0 for SQL statements that return nothing
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * this method is called on a closed <code>Statement</code> or the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     *            SQL statement produces a <code>ResultSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    int executeUpdate(String sql) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * Releases this <code>Statement</code> object's database
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * and JDBC resources immediately instead of waiting for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * this to happen when it is automatically closed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * It is generally good practice to release resources as soon as
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * you are finished with them to avoid tying up database
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * resources.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * Calling the method <code>close</code> on a <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * object that is already closed has no effect.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * <B>Note:</B>When a <code>Statement</code> object is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * closed, its current <code>ResultSet</code> object, if one exists, is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * also closed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * @exception SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    void close() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    //----------------------------------------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * Retrieves the maximum number of bytes that can be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * returned for character and binary column values in a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * object produced by this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * This limit applies only to  <code>BINARY</code>, <code>VARBINARY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * <code>NCHAR</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * and <code>LONGVARCHAR</code> columns.  If the limit is exceeded, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * excess data is silently discarded.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * @return the current column size limit for columns storing character and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     *         binary values; zero means there is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * @see #setMaxFieldSize
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    int getMaxFieldSize() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * Sets the limit for the maximum number of bytes that can be returned for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * character and binary column values in a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * object produced by this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * This limit applies
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * only to <code>BINARY</code>, <code>VARBINARY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * <code>NCHAR</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * <code>LONGVARCHAR</code> fields.  If the limit is exceeded, the excess data
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * is silently discarded. For maximum portability, use values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     * greater than 256.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * @param max the new column size limit in bytes; zero means there is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     *            or the condition max >= 0 is not satisfied
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * @see #getMaxFieldSize
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    void setMaxFieldSize(int max) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * Retrieves the maximum number of rows that a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * <code>ResultSet</code> object produced by this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * <code>Statement</code> object can contain.  If this limit is exceeded,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * the excess rows are silently dropped.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * @return the current maximum number of rows for a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     *         object produced by this <code>Statement</code> object;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     *         zero means there is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * @see #setMaxRows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    int getMaxRows() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * Sets the limit for the maximum number of rows that any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * <code>ResultSet</code> object  generated by this <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * object can contain to the given number.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * If the limit is exceeded, the excess
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * rows are silently dropped.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * @param max the new max rows limit; zero means there is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * @exception SQLException if a database access error occurs,
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
     *            or the condition max >= 0 is not satisfied
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * @see #getMaxRows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    void setMaxRows(int max) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * Sets escape processing on or off.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * If escape scanning is on (the default), the driver will do
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * escape substitution before sending the SQL statement to the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * Note: Since prepared statements have usually been parsed prior
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * to making this call, disabling escape processing for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * <code>PreparedStatements</code> objects will have no effect.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * @param enable <code>true</code> to enable escape processing;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     *       <code>false</code> to disable it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    void setEscapeProcessing(boolean enable) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     * Retrieves the number of seconds the driver will
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * wait for a <code>Statement</code> object to execute.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * If the limit is exceeded, a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * <code>SQLException</code> is thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * @return the current query timeout limit in seconds; zero means there is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     *         no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * @see #setQueryTimeout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    int getQueryTimeout() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * Sets the number of seconds the driver will wait for a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * <code>Statement</code> object to execute to the given number of seconds.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * If the limit is exceeded, an <code>SQLException</code> is thrown. A JDBC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * driver must apply this limit to the <code>execute</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * <code>executeQuery</code> and <code>executeUpdate</code> methods. JDBC driver
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * implementations may also apply this limit to <code>ResultSet</code> methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * (consult your driver vendor documentation for details).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * @param seconds the new query timeout limit in seconds; zero means
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     *        there is no limit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     *            or the condition seconds >= 0 is not satisfied
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * @see #getQueryTimeout
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    void setQueryTimeout(int seconds) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * Cancels this <code>Statement</code> object if both the DBMS and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * driver support aborting an SQL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * This method can be used by one thread to cancel a statement that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * is being executed by another thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     * this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    void cancel() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * Retrieves the first warning reported by calls on this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * Subsequent <code>Statement</code> object warnings will be chained to this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * <code>SQLWarning</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * <p>The warning chain is automatically cleared each time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * a statement is (re)executed. This method may not be called on a closed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * <code>Statement</code> object; doing so will cause an <code>SQLException</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * to be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * <P><B>Note:</B> If you are processing a <code>ResultSet</code> object, any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     * warnings associated with reads on that <code>ResultSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * will be chained on it rather than on the <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * object that produced it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * @return the first <code>SQLWarning</code> object or <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     *         if there are no warnings
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
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    SQLWarning getWarnings() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * Clears all the warnings reported on this <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * object. After a call to this method,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * the method <code>getWarnings</code> will return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * <code>null</code> until a new warning is reported for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
    void clearWarnings() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * Sets the SQL cursor name to the given <code>String</code>, which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * will be used by subsequent <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * <code>execute</code> methods. This name can then be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * used in SQL positioned update or delete statements to identify the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * current row in the <code>ResultSet</code> object generated by this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * statement.  If the database does not support positioned update/delete,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * this method is a noop.  To insure that a cursor has the proper isolation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * level to support updates, the cursor's <code>SELECT</code> statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * should have the form <code>SELECT FOR UPDATE</code>.  If
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * <code>FOR UPDATE</code> is not present, positioned updates may fail.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * <P><B>Note:</B> By definition, the execution of positioned updates and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     * deletes must be done by a different <code>Statement</code> object than
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
     * the one that generated the <code>ResultSet</code> object being used for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     * positioning. Also, cursor names must be unique within a connection.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * @param name the new cursor name, which must be unique within
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     *             a connection
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
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
    void setCursorName(String name) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
    //----------------------- Multiple Results --------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * Executes the given SQL statement, which may return multiple results.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * In some (uncommon) situations, a single SQL statement may return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * multiple result sets and/or update counts.  Normally you can ignore
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     * this unless you are (1) executing a stored procedure that you know may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * return multiple results or (2) you are dynamically executing an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * unknown SQL string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     * The <code>execute</code> method executes an SQL statement and indicates the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * form of the first result.  You must then use the methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
     * <code>getResultSet</code> or <code>getUpdateCount</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * to retrieve the result, and <code>getMoreResults</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
     * move to any subsequent result(s).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     * @param sql any SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * @return <code>true</code> if the first result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     *         object; <code>false</code> if it is an update count or there are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     *         no results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     * @see #getResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     * @see #getUpdateCount
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * @see #getMoreResults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
    boolean execute(String sql) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     *  Retrieves the current result as a <code>ResultSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     *  This method should be called only once per result.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     * @return the current result as a <code>ResultSet</code> object or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     * <code>null</code> if the result is an update count or there are no more results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     * @see #execute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
    ResultSet getResultSet() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     *  Retrieves the current result as an update count;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     *  if the result is a <code>ResultSet</code> object or there are no more results, -1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     *  is returned. This method should be called only once per result.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * @return the current result as an update count; -1 if the current result is a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * <code>ResultSet</code> object or there are no more results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     * @see #execute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
    int getUpdateCount() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * Moves to this <code>Statement</code> object's next result, returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     * <code>true</code> if it is a <code>ResultSet</code> object, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     * implicitly closes any current <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     * object(s) obtained with the method <code>getResultSet</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
     * <P>There are no more results when the following is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     *     // stmt is a Statement object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     *     ((stmt.getMoreResults() == false) && (stmt.getUpdateCount() == -1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * @return <code>true</code> if the next result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     *         object; <code>false</code> if it is an update count or there are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
     *         no more results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * @see #execute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
    boolean getMoreResults() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
    //--------------------------JDBC 2.0-----------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * Gives the driver a hint as to the direction in which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * rows will be processed in <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     * objects created using this <code>Statement</code> object.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     * default value is <code>ResultSet.FETCH_FORWARD</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     * Note that this method sets the default fetch direction for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     * result sets generated by this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     * Each result set has its own methods for getting and setting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * its own fetch direction.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * @param direction the initial direction for processing rows
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     * or the given direction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     * is not one of <code>ResultSet.FETCH_FORWARD</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     * <code>ResultSet.FETCH_REVERSE</code>, or <code>ResultSet.FETCH_UNKNOWN</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * @see #getFetchDirection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
    void setFetchDirection(int direction) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
     * Retrieves the direction for fetching rows from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
     * database tables that is the default for result sets
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
     * generated from this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     * If this <code>Statement</code> object has not set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * a fetch direction by calling the method <code>setFetchDirection</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * the return value is implementation-specific.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     * @return the default fetch direction for result sets generated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     *          from this <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * @see #setFetchDirection
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
    int getFetchDirection() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
     * Gives the JDBC driver a hint as to the number of rows that should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     * be fetched from the database when more rows are needed for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     * <code>ResultSet</code> objects genrated by this <code>Statement</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     * If the value specified is zero, then the hint is ignored.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     * The default value is zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * @param rows the number of rows to fetch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     * this method is called on a closed <code>Statement</code> or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     *        condition  <code>rows >= 0</code> is not satisfied.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     * @see #getFetchSize
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
    void setFetchSize(int rows) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * Retrieves the number of result set rows that is the default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * fetch size for <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * generated from this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * If this <code>Statement</code> object has not set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * a fetch size by calling the method <code>setFetchSize</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * the return value is implementation-specific.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     * @return the default fetch size for result sets generated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     *          from this <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * @see #setFetchSize
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
    int getFetchSize() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     * Retrieves the result set concurrency for <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * generated by this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     * @return either <code>ResultSet.CONCUR_READ_ONLY</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     * <code>ResultSet.CONCUR_UPDATABLE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
    int getResultSetConcurrency() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     * Retrieves the result set type for <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     * generated by this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     * @return one of <code>ResultSet.TYPE_FORWARD_ONLY</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
     * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
    int getResultSetType()  throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * Adds the given SQL command to the current list of commmands for this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     * <code>Statement</code> object. The commands in this list can be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     * executed as a batch by calling the method <code>executeBatch</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     * @param sql typically this is a SQL <code>INSERT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
     * <code>UPDATE</code> statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     * this method is called on a closed <code>Statement</code> or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     * driver does not support batch updates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * @see #executeBatch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     * @see DatabaseMetaData#supportsBatchUpdates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
    void addBatch( String sql ) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     * Empties this <code>Statement</code> object's current list of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
     * SQL commands.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     *  this method is called on a closed <code>Statement</code> or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
     * driver does not support batch updates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
     * @see #addBatch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     * @see DatabaseMetaData#supportsBatchUpdates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
    void clearBatch() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     * Submits a batch of commands to the database for execution and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
     * if all commands execute successfully, returns an array of update counts.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
     * The <code>int</code> elements of the array that is returned are ordered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     * to correspond to the commands in the batch, which are ordered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * according to the order in which they were added to the batch.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * The elements in the array returned by the method <code>executeBatch</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     * may be one of the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     * <OL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     * <LI>A number greater than or equal to zero -- indicates that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     * command was processed successfully and is an update count giving the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     * number of rows in the database that were affected by the command's
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     * execution
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     * <LI>A value of <code>SUCCESS_NO_INFO</code> -- indicates that the command was
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     * processed successfully but that the number of rows affected is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
     * unknown
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     * If one of the commands in a batch update fails to execute properly,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     * this method throws a <code>BatchUpdateException</code>, and a JDBC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     * driver may or may not continue to process the remaining commands in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
     * the batch.  However, the driver's behavior must be consistent with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
     * particular DBMS, either always continuing to process commands or never
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     * continuing to process commands.  If the driver continues processing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
     * after a failure, the array returned by the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     * <code>BatchUpdateException.getUpdateCounts</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     * will contain as many elements as there are commands in the batch, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     * at least one of the elements will be the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     * <LI>A value of <code>EXECUTE_FAILED</code> -- indicates that the command failed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     * to execute successfully and occurs only if a driver continues to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     * process commands after a command fails
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
     * </OL>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     * The possible implementations and return values have been modified in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
     * the Java 2 SDK, Standard Edition, version 1.3 to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     * accommodate the option of continuing to proccess commands in a batch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     * update after a <code>BatchUpdateException</code> obejct has been thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     * @return an array of update counts containing one element for each
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     * command in the batch.  The elements of the array are ordered according
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     * to the order in which commands were added to the batch.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     * this method is called on a closed <code>Statement</code> or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     * driver does not support batch statements. Throws {@link BatchUpdateException}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     * (a subclass of <code>SQLException</code>) if one of the commands sent to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
     * database fails to execute properly or attempts to return a result set.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
     * @see #addBatch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     * @see DatabaseMetaData#supportsBatchUpdates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
    int[] executeBatch() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     * Retrieves the <code>Connection</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     * that produced this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     * @return the connection that produced this statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
     * @since 1.2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
    Connection getConnection()  throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
  //--------------------------JDBC 3.0-----------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
     * The constant indicating that the current <code>ResultSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     * should be closed when calling <code>getMoreResults</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
    int CLOSE_CURRENT_RESULT = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     * The constant indicating that the current <code>ResultSet</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     * should not be closed when calling <code>getMoreResults</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
    int KEEP_CURRENT_RESULT = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
     * The constant indicating that all <code>ResultSet</code> objects that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     * have previously been kept open should be closed when calling
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
     * <code>getMoreResults</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
    int CLOSE_ALL_RESULTS = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     * The constant indicating that a batch statement executed successfully
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     * but that no count of the number of rows it affected is available.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
    int SUCCESS_NO_INFO = -2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
     * The constant indicating that an error occured while executing a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     * batch statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
    int EXECUTE_FAILED = -3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
     * The constant indicating that generated keys should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
     * available for retrieval.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
    int RETURN_GENERATED_KEYS = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
     * The constant indicating that generated keys should not be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
     * available for retrieval.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
    int NO_GENERATED_KEYS = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
     * Moves to this <code>Statement</code> object's next result, deals with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
     * any current <code>ResultSet</code> object(s) according  to the instructions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
     * specified by the given flag, and returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
     * <code>true</code> if the next result is a <code>ResultSet</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
     * <P>There are no more results when the following is true:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
     * <PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
     *     // stmt is a Statement object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
     *     ((stmt.getMoreResults(current) == false) && (stmt.getUpdateCount() == -1))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
     * </PRE>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
     * @param current one of the following <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
     *        constants indicating what should happen to current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
     *        <code>ResultSet</code> objects obtained using the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
     *        <code>getResultSet</code>:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
     *        <code>Statement.CLOSE_CURRENT_RESULT</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
     *        <code>Statement.KEEP_CURRENT_RESULT</code>, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
     *        <code>Statement.CLOSE_ALL_RESULTS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
     * @return <code>true</code> if the next result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
     *         object; <code>false</code> if it is an update count or there are no
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
     *         more results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
     * this method is called on a closed <code>Statement</code> or the argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
         *         supplied is not one of the following:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
     *        <code>Statement.CLOSE_CURRENT_RESULT</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
     *        <code>Statement.KEEP_CURRENT_RESULT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
     *        <code>Statement.CLOSE_ALL_RESULTS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
     *@exception SQLFeatureNotSupportedException if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
     * <code>DatabaseMetaData.supportsMultipleOpenResults</code> returns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
     * <code>false</code> and either
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
     *        <code>Statement.KEEP_CURRENT_RESULT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
     *        <code>Statement.CLOSE_ALL_RESULTS</code> are supplied as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
     * the argument.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
     * @see #execute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
    boolean getMoreResults(int current) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
     * Retrieves any auto-generated keys created as a result of executing this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
     * <code>Statement</code> object. If this <code>Statement</code> object did
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
     * not generate any keys, an empty <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
     * object is returned.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
     *<p><B>Note:</B>If the columns which represent the auto-generated keys were not specified,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
     * the JDBC driver implementation will determine the columns which best represent the auto-generated keys.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
     * @return a <code>ResultSet</code> object containing the auto-generated key(s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
     *         generated by the execution of this <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
    ResultSet getGeneratedKeys() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
     * Executes the given SQL statement and signals the driver with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
     * given flag about whether the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
     * auto-generated keys produced by this <code>Statement</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
     * should be made available for retrieval.  The driver will ignore the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
     * flag if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
     * @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
   683
     * <code>DELETE</code>; or an SQL statement that returns nothing,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
     * such as a DDL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
     * @param autoGeneratedKeys a flag indicating whether auto-generated keys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
     *        should be made available for retrieval;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
     *         one of the following constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
     *         <code>Statement.RETURN_GENERATED_KEYS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
     *         <code>Statement.NO_GENERATED_KEYS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
     * @return either (1) the row count for SQL Data Manipulation Language (DML) statements
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
     *         or (2) 0 for SQL statements that return nothing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
     *  this method is called on a closed <code>Statement</code>, the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
     *            SQL statement returns a <code>ResultSet</code> object, or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
     *            the given constant is not one of those allowed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
     * this method with a constant of Statement.RETURN_GENERATED_KEYS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
    int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
     * Executes the given SQL statement and signals the driver that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
     * auto-generated keys indicated in the given array should be made available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
     * for retrieval.   This array contains the indexes of the columns in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
     * target table that contain the auto-generated keys that should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
     * available. The driver will ignore the array if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
     * @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
   714
     * <code>DELETE</code>; or an SQL statement that returns nothing,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
     * such as a DDL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
     * @param columnIndexes an array of column indexes indicating the columns
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
     *        that should be returned from the inserted row
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
     * @return either (1) the row count for SQL Data Manipulation Language (DML) statements
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
     *         or (2) 0 for SQL statements that return nothing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
     * this method is called on a closed <code>Statement</code>, the SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
     *            statement returns a <code>ResultSet</code> object, or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
     *            second argument supplied to this method is not an <code>int</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
     *            whose elements are valid column indexes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   727
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   728
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   729
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   730
    int executeUpdate(String sql, int columnIndexes[]) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   731
90ce3da70b43 Initial load
duke
parents:
diff changeset
   732
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   733
     * Executes the given SQL statement and signals the driver that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   734
     * auto-generated keys indicated in the given array should be made available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   735
     * for retrieval.   This array contains the names of the columns in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   736
     * target table that contain the auto-generated keys that should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   737
     * available. The driver will ignore the array if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   738
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   739
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   740
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   741
     * @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
   742
     * <code>DELETE</code>; or an SQL statement that returns nothing,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   743
     * such as a DDL statement.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   744
     * @param columnNames an array of the names of the columns that should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   745
     *        returned from the inserted row
90ce3da70b43 Initial load
duke
parents:
diff changeset
   746
     * @return either the row count for <code>INSERT</code>, <code>UPDATE</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   747
     *         or <code>DELETE</code> statements, or 0 for SQL statements
90ce3da70b43 Initial load
duke
parents:
diff changeset
   748
     *         that return nothing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   749
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   750
     *  this method is called on a closed <code>Statement</code>, the SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   751
     *            statement returns a <code>ResultSet</code> object, or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   752
     *            second argument supplied to this method is not a <code>String</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   753
     *            whose elements are valid column names
90ce3da70b43 Initial load
duke
parents:
diff changeset
   754
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   755
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   756
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   757
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   758
    int executeUpdate(String sql, String columnNames[]) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   759
90ce3da70b43 Initial load
duke
parents:
diff changeset
   760
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   761
     * Executes the given SQL statement, which may return multiple results,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   762
     * and signals the driver that any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   763
     * auto-generated keys should be made available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   764
     * for retrieval.  The driver will ignore this signal if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   765
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   766
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   767
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   768
     * In some (uncommon) situations, a single SQL statement may return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   769
     * multiple result sets and/or update counts.  Normally you can ignore
90ce3da70b43 Initial load
duke
parents:
diff changeset
   770
     * this unless you are (1) executing a stored procedure that you know may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   771
     * return multiple results or (2) you are dynamically executing an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   772
     * unknown SQL string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   773
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   774
     * The <code>execute</code> method executes an SQL statement and indicates the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   775
     * form of the first result.  You must then use the methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   776
     * <code>getResultSet</code> or <code>getUpdateCount</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   777
     * to retrieve the result, and <code>getMoreResults</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   778
     * move to any subsequent result(s).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   779
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   780
     * @param sql any SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   781
     * @param autoGeneratedKeys a constant indicating whether auto-generated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   782
     *        keys should be made available for retrieval using the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   783
     *        <code>getGeneratedKeys</code>; one of the following constants:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   784
     *        <code>Statement.RETURN_GENERATED_KEYS</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   785
     *        <code>Statement.NO_GENERATED_KEYS</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   786
     * @return <code>true</code> if the first result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   787
     *         object; <code>false</code> if it is an update count or there are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   788
     *         no results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   789
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   790
     * this method is called on a closed <code>Statement</code> or the second
90ce3da70b43 Initial load
duke
parents:
diff changeset
   791
     *         parameter supplied to this method is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   792
     *         <code>Statement.RETURN_GENERATED_KEYS</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   793
     *         <code>Statement.NO_GENERATED_KEYS</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   794
     * @exception SQLFeatureNotSupportedException if the JDBC driver does not support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   795
     * this method with a constant of Statement.RETURN_GENERATED_KEYS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   796
     * @see #getResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   797
     * @see #getUpdateCount
90ce3da70b43 Initial load
duke
parents:
diff changeset
   798
     * @see #getMoreResults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   799
     * @see #getGeneratedKeys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   800
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   801
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   802
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   803
    boolean execute(String sql, int autoGeneratedKeys) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   804
90ce3da70b43 Initial load
duke
parents:
diff changeset
   805
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   806
     * Executes the given SQL statement, which may return multiple results,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   807
     * and signals the driver that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   808
     * auto-generated keys indicated in the given array should be made available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   809
     * for retrieval.  This array contains the indexes of the columns in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   810
     * target table that contain the auto-generated keys that should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   811
     * available.  The driver will ignore the array if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   812
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   813
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   814
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   815
     * Under some (uncommon) situations, a single SQL statement may return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   816
     * multiple result sets and/or update counts.  Normally you can ignore
90ce3da70b43 Initial load
duke
parents:
diff changeset
   817
     * this unless you are (1) executing a stored procedure that you know may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   818
     * return multiple results or (2) you are dynamically executing an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   819
     * unknown SQL string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   820
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   821
     * The <code>execute</code> method executes an SQL statement and indicates the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
     * form of the first result.  You must then use the methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
     * <code>getResultSet</code> or <code>getUpdateCount</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
     * to retrieve the result, and <code>getMoreResults</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
     * move to any subsequent result(s).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   826
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   827
     * @param sql any SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   828
     * @param columnIndexes an array of the indexes of the columns in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   829
     *        inserted row that should be  made available for retrieval by a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   830
     *        call to the method <code>getGeneratedKeys</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
     * @return <code>true</code> if the first result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   832
     *         object; <code>false</code> if it is an update count or there
90ce3da70b43 Initial load
duke
parents:
diff changeset
   833
     *         are no results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
     * this method is called on a closed <code>Statement</code> or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
     *            elements in the <code>int</code> array passed to this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
     *            are not valid column indexes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   838
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
     * @see #getResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
     * @see #getUpdateCount
90ce3da70b43 Initial load
duke
parents:
diff changeset
   841
     * @see #getMoreResults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   843
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
    boolean execute(String sql, int columnIndexes[]) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
90ce3da70b43 Initial load
duke
parents:
diff changeset
   847
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
     * Executes the given SQL statement, which may return multiple results,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
     * and signals the driver that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
     * auto-generated keys indicated in the given array should be made available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
     * for retrieval. This array contains the names of the columns in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
     * target table that contain the auto-generated keys that should be made
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
     * available.  The driver will ignore the array if the SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
     * is not an <code>INSERT</code> statement, or an SQL statement able to return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
     * auto-generated keys (the list of such statements is vendor-specific).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
     * In some (uncommon) situations, a single SQL statement may return
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
     * multiple result sets and/or update counts.  Normally you can ignore
90ce3da70b43 Initial load
duke
parents:
diff changeset
   859
     * this unless you are (1) executing a stored procedure that you know may
90ce3da70b43 Initial load
duke
parents:
diff changeset
   860
     * return multiple results or (2) you are dynamically executing an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   861
     * unknown SQL string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   862
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   863
     * The <code>execute</code> method executes an SQL statement and indicates the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   864
     * form of the first result.  You must then use the methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
   865
     * <code>getResultSet</code> or <code>getUpdateCount</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   866
     * to retrieve the result, and <code>getMoreResults</code> to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   867
     * move to any subsequent result(s).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   868
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   869
     * @param sql any SQL statement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   870
     * @param columnNames an array of the names of the columns in the inserted
90ce3da70b43 Initial load
duke
parents:
diff changeset
   871
     *        row that should be made available for retrieval by a call to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   872
     *        method <code>getGeneratedKeys</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   873
     * @return <code>true</code> if the next result is a <code>ResultSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   874
     *         object; <code>false</code> if it is an update count or there
90ce3da70b43 Initial load
duke
parents:
diff changeset
   875
     *         are no more results
90ce3da70b43 Initial load
duke
parents:
diff changeset
   876
     * @exception SQLException if a database access error occurs,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   877
     * this method is called on a closed <code>Statement</code> or the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   878
     *          elements of the <code>String</code> array passed to this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   879
     *          method are not valid column names
90ce3da70b43 Initial load
duke
parents:
diff changeset
   880
     * @throws SQLFeatureNotSupportedException  if the JDBC driver does not support this method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   881
     * @see #getResultSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   882
     * @see #getUpdateCount
90ce3da70b43 Initial load
duke
parents:
diff changeset
   883
     * @see #getMoreResults
90ce3da70b43 Initial load
duke
parents:
diff changeset
   884
     * @see #getGeneratedKeys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   885
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   886
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   887
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   888
    boolean execute(String sql, String columnNames[]) throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   889
90ce3da70b43 Initial load
duke
parents:
diff changeset
   890
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   891
     * Retrieves the result set holdability for <code>ResultSet</code> objects
90ce3da70b43 Initial load
duke
parents:
diff changeset
   892
     * generated by this <code>Statement</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   893
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   894
     * @return either <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   895
     *         <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   896
     * @exception SQLException if a database access error occurs or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   897
     * this method is called on a closed <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   898
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   899
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   900
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   901
    int getResultSetHoldability() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   902
90ce3da70b43 Initial load
duke
parents:
diff changeset
   903
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   904
     * 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
   905
     * method close has been called on it, or if it is automatically closed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   906
     * @return true if this <code>Statement</code> object is closed; false if it is still open
90ce3da70b43 Initial load
duke
parents:
diff changeset
   907
     * @throws SQLException if a database access error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   908
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   909
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   910
    boolean isClosed() throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
90ce3da70b43 Initial load
duke
parents:
diff changeset
   912
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   913
         * Requests that a <code>Statement</code> be pooled or not pooled.  The value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   914
         * specified is a hint to the statement pool implementation indicating
90ce3da70b43 Initial load
duke
parents:
diff changeset
   915
         * whether the applicaiton wants the statement to be pooled.  It is up to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   916
         * the statement pool manager as to whether the hint is used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   917
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   918
         * The poolable value of a statement is applicable to both internal
90ce3da70b43 Initial load
duke
parents:
diff changeset
   919
         * statement caches implemented by the driver and external statement caches
90ce3da70b43 Initial load
duke
parents:
diff changeset
   920
         * implemented by application servers and other applications.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   921
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   922
         * By default, a <code>Statement</code> is not poolable when created, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   923
         * a <code>PreparedStatement</code> and <code>CallableStatement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   924
         * are poolable when created.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   925
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   926
         * @param poolable              requests that the statement be pooled if true and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   927
         *                                              that the statement not be pooled if false
90ce3da70b43 Initial load
duke
parents:
diff changeset
   928
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   929
         * @throws SQLException if this method is called on a closed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   930
         * <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   931
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   932
         * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   933
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   934
        void setPoolable(boolean poolable)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   935
                throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   936
90ce3da70b43 Initial load
duke
parents:
diff changeset
   937
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   938
         * Returns a  value indicating whether the <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   939
         * is poolable or not.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   940
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   941
         * @return              <code>true</code> if the <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   942
         * is poolable; <code>false</code> otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
   943
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   944
         * @throws SQLException if this method is called on a closed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   945
         * <code>Statement</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   946
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   947
         * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   948
         * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   949
         * @see java.sql.Statement#setPoolable(boolean) setPoolable(boolean)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   950
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   951
        boolean isPoolable()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   952
                throws SQLException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   953
90ce3da70b43 Initial load
duke
parents:
diff changeset
   954
}