Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/java/sql/Statement.java
38829 views
/*1* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package java.sql;2627/**28* <P>The object used for executing a static SQL statement29* and returning the results it produces.30* <P>31* By default, only one <code>ResultSet</code> object per <code>Statement</code>32* object can be open at the same time. Therefore, if the reading of one33* <code>ResultSet</code> object is interleaved34* with the reading of another, each must have been generated by35* different <code>Statement</code> objects. All execution methods in the36* <code>Statement</code> interface implicitly close a current37* <code>ResultSet</code> object of the statement if an open one exists.38*39* @see Connection#createStatement40* @see ResultSet41*/42public interface Statement extends Wrapper, AutoCloseable {4344/**45* Executes the given SQL statement, which returns a single46* <code>ResultSet</code> object.47*<p>48* <strong>Note:</strong>This method cannot be called on a49* <code>PreparedStatement</code> or <code>CallableStatement</code>.50* @param sql an SQL statement to be sent to the database, typically a51* static SQL <code>SELECT</code> statement52* @return a <code>ResultSet</code> object that contains the data produced53* by the given query; never <code>null</code>54* @exception SQLException if a database access error occurs,55* this method is called on a closed <code>Statement</code>, the given56* SQL statement produces anything other than a single57* <code>ResultSet</code> object, the method is called on a58* <code>PreparedStatement</code> or <code>CallableStatement</code>59* @throws SQLTimeoutException when the driver has determined that the60* timeout value that was specified by the {@code setQueryTimeout}61* method has been exceeded and has at least attempted to cancel62* the currently running {@code Statement}63*/64ResultSet executeQuery(String sql) throws SQLException;6566/**67* Executes the given SQL statement, which may be an <code>INSERT</code>,68* <code>UPDATE</code>, or <code>DELETE</code> statement or an69* SQL statement that returns nothing, such as an SQL DDL statement.70*<p>71* <strong>Note:</strong>This method cannot be called on a72* <code>PreparedStatement</code> or <code>CallableStatement</code>.73* @param sql an SQL Data Manipulation Language (DML) statement, such as <code>INSERT</code>, <code>UPDATE</code> or74* <code>DELETE</code>; or an SQL statement that returns nothing,75* such as a DDL statement.76*77* @return either (1) the row count for SQL Data Manipulation Language (DML) statements78* or (2) 0 for SQL statements that return nothing79*80* @exception SQLException if a database access error occurs,81* this method is called on a closed <code>Statement</code>, the given82* SQL statement produces a <code>ResultSet</code> object, the method is called on a83* <code>PreparedStatement</code> or <code>CallableStatement</code>84* @throws SQLTimeoutException when the driver has determined that the85* timeout value that was specified by the {@code setQueryTimeout}86* method has been exceeded and has at least attempted to cancel87* the currently running {@code Statement}88*/89int executeUpdate(String sql) throws SQLException;9091/**92* Releases this <code>Statement</code> object's database93* and JDBC resources immediately instead of waiting for94* this to happen when it is automatically closed.95* It is generally good practice to release resources as soon as96* you are finished with them to avoid tying up database97* resources.98* <P>99* Calling the method <code>close</code> on a <code>Statement</code>100* object that is already closed has no effect.101* <P>102* <B>Note:</B>When a <code>Statement</code> object is103* closed, its current <code>ResultSet</code> object, if one exists, is104* also closed.105*106* @exception SQLException if a database access error occurs107*/108void close() throws SQLException;109110//----------------------------------------------------------------------111112/**113* Retrieves the maximum number of bytes that can be114* returned for character and binary column values in a <code>ResultSet</code>115* object produced by this <code>Statement</code> object.116* This limit applies only to <code>BINARY</code>, <code>VARBINARY</code>,117* <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,118* <code>NCHAR</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>119* and <code>LONGVARCHAR</code> columns. If the limit is exceeded, the120* excess data is silently discarded.121*122* @return the current column size limit for columns storing character and123* binary values; zero means there is no limit124* @exception SQLException if a database access error occurs or125* this method is called on a closed <code>Statement</code>126* @see #setMaxFieldSize127*/128int getMaxFieldSize() throws SQLException;129130/**131* Sets the limit for the maximum number of bytes that can be returned for132* character and binary column values in a <code>ResultSet</code>133* object produced by this <code>Statement</code> object.134*135* This limit applies136* only to <code>BINARY</code>, <code>VARBINARY</code>,137* <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,138* <code>NCHAR</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code> and139* <code>LONGVARCHAR</code> fields. If the limit is exceeded, the excess data140* is silently discarded. For maximum portability, use values141* greater than 256.142*143* @param max the new column size limit in bytes; zero means there is no limit144* @exception SQLException if a database access error occurs,145* this method is called on a closed <code>Statement</code>146* or the condition {@code max >= 0} is not satisfied147* @see #getMaxFieldSize148*/149void setMaxFieldSize(int max) throws SQLException;150151/**152* Retrieves the maximum number of rows that a153* <code>ResultSet</code> object produced by this154* <code>Statement</code> object can contain. If this limit is exceeded,155* the excess rows are silently dropped.156*157* @return the current maximum number of rows for a <code>ResultSet</code>158* object produced by this <code>Statement</code> object;159* zero means there is no limit160* @exception SQLException if a database access error occurs or161* this method is called on a closed <code>Statement</code>162* @see #setMaxRows163*/164int getMaxRows() throws SQLException;165166/**167* Sets the limit for the maximum number of rows that any168* <code>ResultSet</code> object generated by this <code>Statement</code>169* object can contain to the given number.170* If the limit is exceeded, the excess171* rows are silently dropped.172*173* @param max the new max rows limit; zero means there is no limit174* @exception SQLException if a database access error occurs,175* this method is called on a closed <code>Statement</code>176* or the condition {@code max >= 0} is not satisfied177* @see #getMaxRows178*/179void setMaxRows(int max) throws SQLException;180181/**182* Sets escape processing on or off.183* If escape scanning is on (the default), the driver will do184* escape substitution before sending the SQL statement to the database.185*<p>186* The {@code Connection} and {@code DataSource} property187* {@code escapeProcessing} may be used to change the default escape processing188* behavior. A value of true (the default) enables escape Processing for189* all {@code Statement} objects. A value of false disables escape processing190* for all {@code Statement} objects. The {@code setEscapeProcessing}191* method may be used to specify the escape processing behavior for an192* individual {@code Statement} object.193* <p>194* Note: Since prepared statements have usually been parsed prior195* to making this call, disabling escape processing for196* <code>PreparedStatements</code> objects will have no effect.197*198* @param enable <code>true</code> to enable escape processing;199* <code>false</code> to disable it200* @exception SQLException if a database access error occurs or201* this method is called on a closed <code>Statement</code>202*/203void setEscapeProcessing(boolean enable) throws SQLException;204205/**206* Retrieves the number of seconds the driver will207* wait for a <code>Statement</code> object to execute.208* If the limit is exceeded, a209* <code>SQLException</code> is thrown.210*211* @return the current query timeout limit in seconds; zero means there is212* no limit213* @exception SQLException if a database access error occurs or214* this method is called on a closed <code>Statement</code>215* @see #setQueryTimeout216*/217int getQueryTimeout() throws SQLException;218219/**220* Sets the number of seconds the driver will wait for a221* <code>Statement</code> object to execute to the given number of seconds.222*By default there is no limit on the amount of time allowed for a running223* statement to complete. If the limit is exceeded, an224* <code>SQLTimeoutException</code> is thrown.225* A JDBC driver must apply this limit to the <code>execute</code>,226* <code>executeQuery</code> and <code>executeUpdate</code> methods.227* <p>228* <strong>Note:</strong> JDBC driver implementations may also apply this229* limit to {@code ResultSet} methods230* (consult your driver vendor documentation for details).231* <p>232* <strong>Note:</strong> In the case of {@code Statement} batching, it is233* implementation defined as to whether the time-out is applied to234* individual SQL commands added via the {@code addBatch} method or to235* the entire batch of SQL commands invoked by the {@code executeBatch}236* method (consult your driver vendor documentation for details).237*238* @param seconds the new query timeout limit in seconds; zero means239* there is no limit240* @exception SQLException if a database access error occurs,241* this method is called on a closed <code>Statement</code>242* or the condition {@code seconds >= 0} is not satisfied243* @see #getQueryTimeout244*/245void setQueryTimeout(int seconds) throws SQLException;246247/**248* Cancels this <code>Statement</code> object if both the DBMS and249* driver support aborting an SQL statement.250* This method can be used by one thread to cancel a statement that251* is being executed by another thread.252*253* @exception SQLException if a database access error occurs or254* this method is called on a closed <code>Statement</code>255* @exception SQLFeatureNotSupportedException if the JDBC driver does not support256* this method257*/258void cancel() throws SQLException;259260/**261* Retrieves the first warning reported by calls on this <code>Statement</code> object.262* Subsequent <code>Statement</code> object warnings will be chained to this263* <code>SQLWarning</code> object.264*265* <p>The warning chain is automatically cleared each time266* a statement is (re)executed. This method may not be called on a closed267* <code>Statement</code> object; doing so will cause an <code>SQLException</code>268* to be thrown.269*270* <P><B>Note:</B> If you are processing a <code>ResultSet</code> object, any271* warnings associated with reads on that <code>ResultSet</code> object272* will be chained on it rather than on the <code>Statement</code>273* object that produced it.274*275* @return the first <code>SQLWarning</code> object or <code>null</code>276* if there are no warnings277* @exception SQLException if a database access error occurs or278* this method is called on a closed <code>Statement</code>279*/280SQLWarning getWarnings() throws SQLException;281282/**283* Clears all the warnings reported on this <code>Statement</code>284* object. After a call to this method,285* the method <code>getWarnings</code> will return286* <code>null</code> until a new warning is reported for this287* <code>Statement</code> object.288*289* @exception SQLException if a database access error occurs or290* this method is called on a closed <code>Statement</code>291*/292void clearWarnings() throws SQLException;293294/**295* Sets the SQL cursor name to the given <code>String</code>, which296* will be used by subsequent <code>Statement</code> object297* <code>execute</code> methods. This name can then be298* used in SQL positioned update or delete statements to identify the299* current row in the <code>ResultSet</code> object generated by this300* statement. If the database does not support positioned update/delete,301* this method is a noop. To insure that a cursor has the proper isolation302* level to support updates, the cursor's <code>SELECT</code> statement303* should have the form <code>SELECT FOR UPDATE</code>. If304* <code>FOR UPDATE</code> is not present, positioned updates may fail.305*306* <P><B>Note:</B> By definition, the execution of positioned updates and307* deletes must be done by a different <code>Statement</code> object than308* the one that generated the <code>ResultSet</code> object being used for309* positioning. Also, cursor names must be unique within a connection.310*311* @param name the new cursor name, which must be unique within312* a connection313* @exception SQLException if a database access error occurs or314* this method is called on a closed <code>Statement</code>315* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method316*/317void setCursorName(String name) throws SQLException;318319//----------------------- Multiple Results --------------------------320321/**322* Executes the given SQL statement, which may return multiple results.323* In some (uncommon) situations, a single SQL statement may return324* multiple result sets and/or update counts. Normally you can ignore325* this unless you are (1) executing a stored procedure that you know may326* return multiple results or (2) you are dynamically executing an327* unknown SQL string.328* <P>329* The <code>execute</code> method executes an SQL statement and indicates the330* form of the first result. You must then use the methods331* <code>getResultSet</code> or <code>getUpdateCount</code>332* to retrieve the result, and <code>getMoreResults</code> to333* move to any subsequent result(s).334* <p>335*<strong>Note:</strong>This method cannot be called on a336* <code>PreparedStatement</code> or <code>CallableStatement</code>.337* @param sql any SQL statement338* @return <code>true</code> if the first result is a <code>ResultSet</code>339* object; <code>false</code> if it is an update count or there are340* no results341* @exception SQLException if a database access error occurs,342* this method is called on a closed <code>Statement</code>,343* the method is called on a344* <code>PreparedStatement</code> or <code>CallableStatement</code>345* @throws SQLTimeoutException when the driver has determined that the346* timeout value that was specified by the {@code setQueryTimeout}347* method has been exceeded and has at least attempted to cancel348* the currently running {@code Statement}349* @see #getResultSet350* @see #getUpdateCount351* @see #getMoreResults352*/353boolean execute(String sql) throws SQLException;354355/**356* Retrieves the current result as a <code>ResultSet</code> object.357* This method should be called only once per result.358*359* @return the current result as a <code>ResultSet</code> object or360* <code>null</code> if the result is an update count or there are no more results361* @exception SQLException if a database access error occurs or362* this method is called on a closed <code>Statement</code>363* @see #execute364*/365ResultSet getResultSet() throws SQLException;366367/**368* Retrieves the current result as an update count;369* if the result is a <code>ResultSet</code> object or there are no more results, -1370* is returned. This method should be called only once per result.371*372* @return the current result as an update count; -1 if the current result is a373* <code>ResultSet</code> object or there are no more results374* @exception SQLException if a database access error occurs or375* this method is called on a closed <code>Statement</code>376* @see #execute377*/378int getUpdateCount() throws SQLException;379380/**381* Moves to this <code>Statement</code> object's next result, returns382* <code>true</code> if it is a <code>ResultSet</code> object, and383* implicitly closes any current <code>ResultSet</code>384* object(s) obtained with the method <code>getResultSet</code>.385*386* <P>There are no more results when the following is true:387* <PRE>{@code388* // stmt is a Statement object389* ((stmt.getMoreResults() == false) && (stmt.getUpdateCount() == -1))390* }</PRE>391*392* @return <code>true</code> if the next result is a <code>ResultSet</code>393* object; <code>false</code> if it is an update count or there are394* no more results395* @exception SQLException if a database access error occurs or396* this method is called on a closed <code>Statement</code>397* @see #execute398*/399boolean getMoreResults() throws SQLException;400401402//--------------------------JDBC 2.0-----------------------------403404405/**406* Gives the driver a hint as to the direction in which407* rows will be processed in <code>ResultSet</code>408* objects created using this <code>Statement</code> object. The409* default value is <code>ResultSet.FETCH_FORWARD</code>.410* <P>411* Note that this method sets the default fetch direction for412* result sets generated by this <code>Statement</code> object.413* Each result set has its own methods for getting and setting414* its own fetch direction.415*416* @param direction the initial direction for processing rows417* @exception SQLException if a database access error occurs,418* this method is called on a closed <code>Statement</code>419* or the given direction420* is not one of <code>ResultSet.FETCH_FORWARD</code>,421* <code>ResultSet.FETCH_REVERSE</code>, or <code>ResultSet.FETCH_UNKNOWN</code>422* @since 1.2423* @see #getFetchDirection424*/425void setFetchDirection(int direction) throws SQLException;426427/**428* Retrieves the direction for fetching rows from429* database tables that is the default for result sets430* generated from this <code>Statement</code> object.431* If this <code>Statement</code> object has not set432* a fetch direction by calling the method <code>setFetchDirection</code>,433* the return value is implementation-specific.434*435* @return the default fetch direction for result sets generated436* from this <code>Statement</code> object437* @exception SQLException if a database access error occurs or438* this method is called on a closed <code>Statement</code>439* @since 1.2440* @see #setFetchDirection441*/442int getFetchDirection() throws SQLException;443444/**445* Gives the JDBC driver a hint as to the number of rows that should446* be fetched from the database when more rows are needed for447* <code>ResultSet</code> objects generated by this <code>Statement</code>.448* If the value specified is zero, then the hint is ignored.449* The default value is zero.450*451* @param rows the number of rows to fetch452* @exception SQLException if a database access error occurs,453* this method is called on a closed <code>Statement</code> or the454* condition {@code rows >= 0} is not satisfied.455* @since 1.2456* @see #getFetchSize457*/458void setFetchSize(int rows) throws SQLException;459460/**461* Retrieves the number of result set rows that is the default462* fetch size for <code>ResultSet</code> objects463* generated from this <code>Statement</code> object.464* If this <code>Statement</code> object has not set465* a fetch size by calling the method <code>setFetchSize</code>,466* the return value is implementation-specific.467*468* @return the default fetch size for result sets generated469* from this <code>Statement</code> object470* @exception SQLException if a database access error occurs or471* this method is called on a closed <code>Statement</code>472* @since 1.2473* @see #setFetchSize474*/475int getFetchSize() throws SQLException;476477/**478* Retrieves the result set concurrency for <code>ResultSet</code> objects479* generated by this <code>Statement</code> object.480*481* @return either <code>ResultSet.CONCUR_READ_ONLY</code> or482* <code>ResultSet.CONCUR_UPDATABLE</code>483* @exception SQLException if a database access error occurs or484* this method is called on a closed <code>Statement</code>485* @since 1.2486*/487int getResultSetConcurrency() throws SQLException;488489/**490* Retrieves the result set type for <code>ResultSet</code> objects491* generated by this <code>Statement</code> object.492*493* @return one of <code>ResultSet.TYPE_FORWARD_ONLY</code>,494* <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or495* <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>496* @exception SQLException if a database access error occurs or497* this method is called on a closed <code>Statement</code>498* @since 1.2499*/500int getResultSetType() throws SQLException;501502/**503* Adds the given SQL command to the current list of commands for this504* <code>Statement</code> object. The commands in this list can be505* executed as a batch by calling the method <code>executeBatch</code>.506* <P>507*<strong>Note:</strong>This method cannot be called on a508* <code>PreparedStatement</code> or <code>CallableStatement</code>.509* @param sql typically this is a SQL <code>INSERT</code> or510* <code>UPDATE</code> statement511* @exception SQLException if a database access error occurs,512* this method is called on a closed <code>Statement</code>, the513* driver does not support batch updates, the method is called on a514* <code>PreparedStatement</code> or <code>CallableStatement</code>515* @see #executeBatch516* @see DatabaseMetaData#supportsBatchUpdates517* @since 1.2518*/519void addBatch( String sql ) throws SQLException;520521/**522* Empties this <code>Statement</code> object's current list of523* SQL commands.524* <P>525* @exception SQLException if a database access error occurs,526* this method is called on a closed <code>Statement</code> or the527* driver does not support batch updates528* @see #addBatch529* @see DatabaseMetaData#supportsBatchUpdates530* @since 1.2531*/532void clearBatch() throws SQLException;533534/**535* Submits a batch of commands to the database for execution and536* if all commands execute successfully, returns an array of update counts.537* The <code>int</code> elements of the array that is returned are ordered538* to correspond to the commands in the batch, which are ordered539* according to the order in which they were added to the batch.540* The elements in the array returned by the method <code>executeBatch</code>541* may be one of the following:542* <OL>543* <LI>A number greater than or equal to zero -- indicates that the544* command was processed successfully and is an update count giving the545* number of rows in the database that were affected by the command's546* execution547* <LI>A value of <code>SUCCESS_NO_INFO</code> -- indicates that the command was548* processed successfully but that the number of rows affected is549* unknown550* <P>551* If one of the commands in a batch update fails to execute properly,552* this method throws a <code>BatchUpdateException</code>, and a JDBC553* driver may or may not continue to process the remaining commands in554* the batch. However, the driver's behavior must be consistent with a555* particular DBMS, either always continuing to process commands or never556* continuing to process commands. If the driver continues processing557* after a failure, the array returned by the method558* <code>BatchUpdateException.getUpdateCounts</code>559* will contain as many elements as there are commands in the batch, and560* at least one of the elements will be the following:561*562* <LI>A value of <code>EXECUTE_FAILED</code> -- indicates that the command failed563* to execute successfully and occurs only if a driver continues to564* process commands after a command fails565* </OL>566* <P>567* The possible implementations and return values have been modified in568* the Java 2 SDK, Standard Edition, version 1.3 to569* accommodate the option of continuing to process commands in a batch570* update after a <code>BatchUpdateException</code> object has been thrown.571*572* @return an array of update counts containing one element for each573* command in the batch. The elements of the array are ordered according574* to the order in which commands were added to the batch.575* @exception SQLException if a database access error occurs,576* this method is called on a closed <code>Statement</code> or the577* driver does not support batch statements. Throws {@link BatchUpdateException}578* (a subclass of <code>SQLException</code>) if one of the commands sent to the579* database fails to execute properly or attempts to return a result set.580* @throws SQLTimeoutException when the driver has determined that the581* timeout value that was specified by the {@code setQueryTimeout}582* method has been exceeded and has at least attempted to cancel583* the currently running {@code Statement}584*585* @see #addBatch586* @see DatabaseMetaData#supportsBatchUpdates587* @since 1.2588*/589int[] executeBatch() throws SQLException;590591/**592* Retrieves the <code>Connection</code> object593* that produced this <code>Statement</code> object.594* @return the connection that produced this statement595* @exception SQLException if a database access error occurs or596* this method is called on a closed <code>Statement</code>597* @since 1.2598*/599Connection getConnection() throws SQLException;600601//--------------------------JDBC 3.0-----------------------------602603/**604* The constant indicating that the current <code>ResultSet</code> object605* should be closed when calling <code>getMoreResults</code>.606*607* @since 1.4608*/609int CLOSE_CURRENT_RESULT = 1;610611/**612* The constant indicating that the current <code>ResultSet</code> object613* should not be closed when calling <code>getMoreResults</code>.614*615* @since 1.4616*/617int KEEP_CURRENT_RESULT = 2;618619/**620* The constant indicating that all <code>ResultSet</code> objects that621* have previously been kept open should be closed when calling622* <code>getMoreResults</code>.623*624* @since 1.4625*/626int CLOSE_ALL_RESULTS = 3;627628/**629* The constant indicating that a batch statement executed successfully630* but that no count of the number of rows it affected is available.631*632* @since 1.4633*/634int SUCCESS_NO_INFO = -2;635636/**637* The constant indicating that an error occurred while executing a638* batch statement.639*640* @since 1.4641*/642int EXECUTE_FAILED = -3;643644/**645* The constant indicating that generated keys should be made646* available for retrieval.647*648* @since 1.4649*/650int RETURN_GENERATED_KEYS = 1;651652/**653* The constant indicating that generated keys should not be made654* available for retrieval.655*656* @since 1.4657*/658int NO_GENERATED_KEYS = 2;659660/**661* Moves to this <code>Statement</code> object's next result, deals with662* any current <code>ResultSet</code> object(s) according to the instructions663* specified by the given flag, and returns664* <code>true</code> if the next result is a <code>ResultSet</code> object.665*666* <P>There are no more results when the following is true:667* <PRE>{@code668* // stmt is a Statement object669* ((stmt.getMoreResults(current) == false) && (stmt.getUpdateCount() == -1))670* }</PRE>671*672* @param current one of the following <code>Statement</code>673* constants indicating what should happen to current674* <code>ResultSet</code> objects obtained using the method675* <code>getResultSet</code>:676* <code>Statement.CLOSE_CURRENT_RESULT</code>,677* <code>Statement.KEEP_CURRENT_RESULT</code>, or678* <code>Statement.CLOSE_ALL_RESULTS</code>679* @return <code>true</code> if the next result is a <code>ResultSet</code>680* object; <code>false</code> if it is an update count or there are no681* more results682* @exception SQLException if a database access error occurs,683* this method is called on a closed <code>Statement</code> or the argument684* supplied is not one of the following:685* <code>Statement.CLOSE_CURRENT_RESULT</code>,686* <code>Statement.KEEP_CURRENT_RESULT</code> or687* <code>Statement.CLOSE_ALL_RESULTS</code>688*@exception SQLFeatureNotSupportedException if689* <code>DatabaseMetaData.supportsMultipleOpenResults</code> returns690* <code>false</code> and either691* <code>Statement.KEEP_CURRENT_RESULT</code> or692* <code>Statement.CLOSE_ALL_RESULTS</code> are supplied as693* the argument.694* @since 1.4695* @see #execute696*/697boolean getMoreResults(int current) throws SQLException;698699/**700* Retrieves any auto-generated keys created as a result of executing this701* <code>Statement</code> object. If this <code>Statement</code> object did702* not generate any keys, an empty <code>ResultSet</code>703* object is returned.704*705*<p><B>Note:</B>If the columns which represent the auto-generated keys were not specified,706* the JDBC driver implementation will determine the columns which best represent the auto-generated keys.707*708* @return a <code>ResultSet</code> object containing the auto-generated key(s)709* generated by the execution of this <code>Statement</code> object710* @exception SQLException if a database access error occurs or711* this method is called on a closed <code>Statement</code>712* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method713* @since 1.4714*/715ResultSet getGeneratedKeys() throws SQLException;716717/**718* Executes the given SQL statement and signals the driver with the719* given flag about whether the720* auto-generated keys produced by this <code>Statement</code> object721* should be made available for retrieval. The driver will ignore the722* flag if the SQL statement723* is not an <code>INSERT</code> statement, or an SQL statement able to return724* auto-generated keys (the list of such statements is vendor-specific).725*<p>726* <strong>Note:</strong>This method cannot be called on a727* <code>PreparedStatement</code> or <code>CallableStatement</code>.728* @param sql an SQL Data Manipulation Language (DML) statement, such as <code>INSERT</code>, <code>UPDATE</code> or729* <code>DELETE</code>; or an SQL statement that returns nothing,730* such as a DDL statement.731*732* @param autoGeneratedKeys a flag indicating whether auto-generated keys733* should be made available for retrieval;734* one of the following constants:735* <code>Statement.RETURN_GENERATED_KEYS</code>736* <code>Statement.NO_GENERATED_KEYS</code>737* @return either (1) the row count for SQL Data Manipulation Language (DML) statements738* or (2) 0 for SQL statements that return nothing739*740* @exception SQLException if a database access error occurs,741* this method is called on a closed <code>Statement</code>, the given742* SQL statement returns a <code>ResultSet</code> object,743* the given constant is not one of those allowed, the method is called on a744* <code>PreparedStatement</code> or <code>CallableStatement</code>745* @exception SQLFeatureNotSupportedException if the JDBC driver does not support746* this method with a constant of Statement.RETURN_GENERATED_KEYS747* @throws SQLTimeoutException when the driver has determined that the748* timeout value that was specified by the {@code setQueryTimeout}749* method has been exceeded and has at least attempted to cancel750* the currently running {@code Statement}751* @since 1.4752*/753int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException;754755/**756* Executes the given SQL statement and signals the driver that the757* auto-generated keys indicated in the given array should be made available758* for retrieval. This array contains the indexes of the columns in the759* target table that contain the auto-generated keys that should be made760* available. The driver will ignore the array if the SQL statement761* is not an <code>INSERT</code> statement, or an SQL statement able to return762* auto-generated keys (the list of such statements is vendor-specific).763*<p>764* <strong>Note:</strong>This method cannot be called on a765* <code>PreparedStatement</code> or <code>CallableStatement</code>.766* @param sql an SQL Data Manipulation Language (DML) statement, such as <code>INSERT</code>, <code>UPDATE</code> or767* <code>DELETE</code>; or an SQL statement that returns nothing,768* such as a DDL statement.769*770* @param columnIndexes an array of column indexes indicating the columns771* that should be returned from the inserted row772* @return either (1) the row count for SQL Data Manipulation Language (DML) statements773* or (2) 0 for SQL statements that return nothing774*775* @exception SQLException if a database access error occurs,776* this method is called on a closed <code>Statement</code>, the SQL777* statement returns a <code>ResultSet</code> object,the second argument778* supplied to this method is not an779* <code>int</code> array whose elements are valid column indexes, the method is called on a780* <code>PreparedStatement</code> or <code>CallableStatement</code>781* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method782* @throws SQLTimeoutException when the driver has determined that the783* timeout value that was specified by the {@code setQueryTimeout}784* method has been exceeded and has at least attempted to cancel785* the currently running {@code Statement}786* @since 1.4787*/788int executeUpdate(String sql, int columnIndexes[]) throws SQLException;789790/**791* Executes the given SQL statement and signals the driver that the792* auto-generated keys indicated in the given array should be made available793* for retrieval. This array contains the names of the columns in the794* target table that contain the auto-generated keys that should be made795* available. The driver will ignore the array if the SQL statement796* is not an <code>INSERT</code> statement, or an SQL statement able to return797* auto-generated keys (the list of such statements is vendor-specific).798*<p>799* <strong>Note:</strong>This method cannot be called on a800* <code>PreparedStatement</code> or <code>CallableStatement</code>.801* @param sql an SQL Data Manipulation Language (DML) statement, such as <code>INSERT</code>, <code>UPDATE</code> or802* <code>DELETE</code>; or an SQL statement that returns nothing,803* such as a DDL statement.804* @param columnNames an array of the names of the columns that should be805* returned from the inserted row806* @return either the row count for <code>INSERT</code>, <code>UPDATE</code>,807* or <code>DELETE</code> statements, or 0 for SQL statements808* that return nothing809* @exception SQLException if a database access error occurs,810* this method is called on a closed <code>Statement</code>, the SQL811* statement returns a <code>ResultSet</code> object, the812* second argument supplied to this method is not a <code>String</code> array813* whose elements are valid column names, the method is called on a814* <code>PreparedStatement</code> or <code>CallableStatement</code>815* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method816* @throws SQLTimeoutException when the driver has determined that the817* timeout value that was specified by the {@code setQueryTimeout}818* method has been exceeded and has at least attempted to cancel819* the currently running {@code Statement}820* @since 1.4821*/822int executeUpdate(String sql, String columnNames[]) throws SQLException;823824/**825* Executes the given SQL statement, which may return multiple results,826* and signals the driver that any827* auto-generated keys should be made available828* for retrieval. The driver will ignore this signal if the SQL statement829* is not an <code>INSERT</code> statement, or an SQL statement able to return830* auto-generated keys (the list of such statements is vendor-specific).831* <P>832* In some (uncommon) situations, a single SQL statement may return833* multiple result sets and/or update counts. Normally you can ignore834* this unless you are (1) executing a stored procedure that you know may835* return multiple results or (2) you are dynamically executing an836* unknown SQL string.837* <P>838* The <code>execute</code> method executes an SQL statement and indicates the839* form of the first result. You must then use the methods840* <code>getResultSet</code> or <code>getUpdateCount</code>841* to retrieve the result, and <code>getMoreResults</code> to842* move to any subsequent result(s).843*<p>844*<strong>Note:</strong>This method cannot be called on a845* <code>PreparedStatement</code> or <code>CallableStatement</code>.846* @param sql any SQL statement847* @param autoGeneratedKeys a constant indicating whether auto-generated848* keys should be made available for retrieval using the method849* <code>getGeneratedKeys</code>; one of the following constants:850* <code>Statement.RETURN_GENERATED_KEYS</code> or851* <code>Statement.NO_GENERATED_KEYS</code>852* @return <code>true</code> if the first result is a <code>ResultSet</code>853* object; <code>false</code> if it is an update count or there are854* no results855* @exception SQLException if a database access error occurs,856* this method is called on a closed <code>Statement</code>, the second857* parameter supplied to this method is not858* <code>Statement.RETURN_GENERATED_KEYS</code> or859* <code>Statement.NO_GENERATED_KEYS</code>,860* the method is called on a861* <code>PreparedStatement</code> or <code>CallableStatement</code>862* @exception SQLFeatureNotSupportedException if the JDBC driver does not support863* this method with a constant of Statement.RETURN_GENERATED_KEYS864* @throws SQLTimeoutException when the driver has determined that the865* timeout value that was specified by the {@code setQueryTimeout}866* method has been exceeded and has at least attempted to cancel867* the currently running {@code Statement}868* @see #getResultSet869* @see #getUpdateCount870* @see #getMoreResults871* @see #getGeneratedKeys872*873* @since 1.4874*/875boolean execute(String sql, int autoGeneratedKeys) throws SQLException;876877/**878* Executes the given SQL statement, which may return multiple results,879* and signals the driver that the880* auto-generated keys indicated in the given array should be made available881* for retrieval. This array contains the indexes of the columns in the882* target table that contain the auto-generated keys that should be made883* available. The driver will ignore the array if the SQL statement884* is not an <code>INSERT</code> statement, or an SQL statement able to return885* auto-generated keys (the list of such statements is vendor-specific).886* <P>887* Under some (uncommon) situations, a single SQL statement may return888* multiple result sets and/or update counts. Normally you can ignore889* this unless you are (1) executing a stored procedure that you know may890* return multiple results or (2) you are dynamically executing an891* unknown SQL string.892* <P>893* The <code>execute</code> method executes an SQL statement and indicates the894* form of the first result. You must then use the methods895* <code>getResultSet</code> or <code>getUpdateCount</code>896* to retrieve the result, and <code>getMoreResults</code> to897* move to any subsequent result(s).898*<p>899* <strong>Note:</strong>This method cannot be called on a900* <code>PreparedStatement</code> or <code>CallableStatement</code>.901* @param sql any SQL statement902* @param columnIndexes an array of the indexes of the columns in the903* inserted row that should be made available for retrieval by a904* call to the method <code>getGeneratedKeys</code>905* @return <code>true</code> if the first result is a <code>ResultSet</code>906* object; <code>false</code> if it is an update count or there907* are no results908* @exception SQLException if a database access error occurs,909* this method is called on a closed <code>Statement</code>, the910* elements in the <code>int</code> array passed to this method911* are not valid column indexes, the method is called on a912* <code>PreparedStatement</code> or <code>CallableStatement</code>913* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method914* @throws SQLTimeoutException when the driver has determined that the915* timeout value that was specified by the {@code setQueryTimeout}916* method has been exceeded and has at least attempted to cancel917* the currently running {@code Statement}918* @see #getResultSet919* @see #getUpdateCount920* @see #getMoreResults921*922* @since 1.4923*/924boolean execute(String sql, int columnIndexes[]) throws SQLException;925926/**927* Executes the given SQL statement, which may return multiple results,928* and signals the driver that the929* auto-generated keys indicated in the given array should be made available930* for retrieval. This array contains the names of the columns in the931* target table that contain the auto-generated keys that should be made932* available. The driver will ignore the array if the SQL statement933* is not an <code>INSERT</code> statement, or an SQL statement able to return934* auto-generated keys (the list of such statements is vendor-specific).935* <P>936* In some (uncommon) situations, a single SQL statement may return937* multiple result sets and/or update counts. Normally you can ignore938* this unless you are (1) executing a stored procedure that you know may939* return multiple results or (2) you are dynamically executing an940* unknown SQL string.941* <P>942* The <code>execute</code> method executes an SQL statement and indicates the943* form of the first result. You must then use the methods944* <code>getResultSet</code> or <code>getUpdateCount</code>945* to retrieve the result, and <code>getMoreResults</code> to946* move to any subsequent result(s).947*<p>948* <strong>Note:</strong>This method cannot be called on a949* <code>PreparedStatement</code> or <code>CallableStatement</code>.950* @param sql any SQL statement951* @param columnNames an array of the names of the columns in the inserted952* row that should be made available for retrieval by a call to the953* method <code>getGeneratedKeys</code>954* @return <code>true</code> if the next result is a <code>ResultSet</code>955* object; <code>false</code> if it is an update count or there956* are no more results957* @exception SQLException if a database access error occurs,958* this method is called on a closed <code>Statement</code>,the959* elements of the <code>String</code> array passed to this960* method are not valid column names, the method is called on a961* <code>PreparedStatement</code> or <code>CallableStatement</code>962* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method963* @throws SQLTimeoutException when the driver has determined that the964* timeout value that was specified by the {@code setQueryTimeout}965* method has been exceeded and has at least attempted to cancel966* the currently running {@code Statement}967* @see #getResultSet968* @see #getUpdateCount969* @see #getMoreResults970* @see #getGeneratedKeys971*972* @since 1.4973*/974boolean execute(String sql, String columnNames[]) throws SQLException;975976/**977* Retrieves the result set holdability for <code>ResultSet</code> objects978* generated by this <code>Statement</code> object.979*980* @return either <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or981* <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>982* @exception SQLException if a database access error occurs or983* this method is called on a closed <code>Statement</code>984*985* @since 1.4986*/987int getResultSetHoldability() throws SQLException;988989/**990* Retrieves whether this <code>Statement</code> object has been closed. A <code>Statement</code> is closed if the991* method close has been called on it, or if it is automatically closed.992* @return true if this <code>Statement</code> object is closed; false if it is still open993* @throws SQLException if a database access error occurs994* @since 1.6995*/996boolean isClosed() throws SQLException;997998/**999* Requests that a <code>Statement</code> be pooled or not pooled. The value1000* specified is a hint to the statement pool implementation indicating1001* whether the application wants the statement to be pooled. It is up to1002* the statement pool manager as to whether the hint is used.1003* <p>1004* The poolable value of a statement is applicable to both internal1005* statement caches implemented by the driver and external statement caches1006* implemented by application servers and other applications.1007* <p>1008* By default, a <code>Statement</code> is not poolable when created, and1009* a <code>PreparedStatement</code> and <code>CallableStatement</code>1010* are poolable when created.1011* <p>1012* @param poolable requests that the statement be pooled if true and1013* that the statement not be pooled if false1014* <p>1015* @throws SQLException if this method is called on a closed1016* <code>Statement</code>1017* <p>1018* @since 1.61019*/1020void setPoolable(boolean poolable)1021throws SQLException;10221023/**1024* Returns a value indicating whether the <code>Statement</code>1025* is poolable or not.1026* <p>1027* @return <code>true</code> if the <code>Statement</code>1028* is poolable; <code>false</code> otherwise1029* <p>1030* @throws SQLException if this method is called on a closed1031* <code>Statement</code>1032* <p>1033* @since 1.61034* <p>1035* @see java.sql.Statement#setPoolable(boolean) setPoolable(boolean)1036*/1037boolean isPoolable()1038throws SQLException;10391040//--------------------------JDBC 4.1 -----------------------------10411042/**1043* Specifies that this {@code Statement} will be closed when all its1044* dependent result sets are closed. If execution of the {@code Statement}1045* does not produce any result sets, this method has no effect.1046* <p>1047* <strong>Note:</strong> Multiple calls to {@code closeOnCompletion} do1048* not toggle the effect on this {@code Statement}. However, a call to1049* {@code closeOnCompletion} does effect both the subsequent execution of1050* statements, and statements that currently have open, dependent,1051* result sets.1052*1053* @throws SQLException if this method is called on a closed1054* {@code Statement}1055* @since 1.71056*/1057public void closeOnCompletion() throws SQLException;10581059/**1060* Returns a value indicating whether this {@code Statement} will be1061* closed when all its dependent result sets are closed.1062* @return {@code true} if the {@code Statement} will be closed when all1063* of its dependent result sets are closed; {@code false} otherwise1064* @throws SQLException if this method is called on a closed1065* {@code Statement}1066* @since 1.71067*/1068public boolean isCloseOnCompletion() throws SQLException;106910701071//--------------------------JDBC 4.2 -----------------------------10721073/**1074* Retrieves the current result as an update count; if the result1075* is a <code>ResultSet</code> object or there are no more results, -11076* is returned. This method should be called only once per result.1077* <p>1078* This method should be used when the returned row count may exceed1079* {@link Integer#MAX_VALUE}.1080*<p>1081* The default implementation will throw {@code UnsupportedOperationException}1082*1083* @return the current result as an update count; -1 if the current result1084* is a <code>ResultSet</code> object or there are no more results1085* @exception SQLException if a database access error occurs or1086* this method is called on a closed <code>Statement</code>1087* @see #execute1088* @since 1.81089*/1090default long getLargeUpdateCount() throws SQLException {1091throw new UnsupportedOperationException("getLargeUpdateCount not implemented");1092}10931094/**1095* Sets the limit for the maximum number of rows that any1096* <code>ResultSet</code> object generated by this <code>Statement</code>1097* object can contain to the given number.1098* If the limit is exceeded, the excess1099* rows are silently dropped.1100* <p>1101* This method should be used when the row limit may exceed1102* {@link Integer#MAX_VALUE}.1103*<p>1104* The default implementation will throw {@code UnsupportedOperationException}1105*1106* @param max the new max rows limit; zero means there is no limit1107* @exception SQLException if a database access error occurs,1108* this method is called on a closed <code>Statement</code>1109* or the condition {@code max >= 0} is not satisfied1110* @see #getMaxRows1111* @since 1.81112*/1113default void setLargeMaxRows(long max) throws SQLException {1114throw new UnsupportedOperationException("setLargeMaxRows not implemented");1115}11161117/**1118* Retrieves the maximum number of rows that a1119* <code>ResultSet</code> object produced by this1120* <code>Statement</code> object can contain. If this limit is exceeded,1121* the excess rows are silently dropped.1122* <p>1123* This method should be used when the returned row limit may exceed1124* {@link Integer#MAX_VALUE}.1125*<p>1126* The default implementation will return {@code 0}1127*1128* @return the current maximum number of rows for a <code>ResultSet</code>1129* object produced by this <code>Statement</code> object;1130* zero means there is no limit1131* @exception SQLException if a database access error occurs or1132* this method is called on a closed <code>Statement</code>1133* @see #setMaxRows1134* @since 1.81135*/1136default long getLargeMaxRows() throws SQLException {1137return 0;1138}11391140/**1141* Submits a batch of commands to the database for execution and1142* if all commands execute successfully, returns an array of update counts.1143* The <code>long</code> elements of the array that is returned are ordered1144* to correspond to the commands in the batch, which are ordered1145* according to the order in which they were added to the batch.1146* The elements in the array returned by the method {@code executeLargeBatch}1147* may be one of the following:1148* <OL>1149* <LI>A number greater than or equal to zero -- indicates that the1150* command was processed successfully and is an update count giving the1151* number of rows in the database that were affected by the command's1152* execution1153* <LI>A value of <code>SUCCESS_NO_INFO</code> -- indicates that the command was1154* processed successfully but that the number of rows affected is1155* unknown1156* <P>1157* If one of the commands in a batch update fails to execute properly,1158* this method throws a <code>BatchUpdateException</code>, and a JDBC1159* driver may or may not continue to process the remaining commands in1160* the batch. However, the driver's behavior must be consistent with a1161* particular DBMS, either always continuing to process commands or never1162* continuing to process commands. If the driver continues processing1163* after a failure, the array returned by the method1164* <code>BatchUpdateException.getLargeUpdateCounts</code>1165* will contain as many elements as there are commands in the batch, and1166* at least one of the elements will be the following:1167*1168* <LI>A value of <code>EXECUTE_FAILED</code> -- indicates that the command failed1169* to execute successfully and occurs only if a driver continues to1170* process commands after a command fails1171* </OL>1172* <p>1173* This method should be used when the returned row count may exceed1174* {@link Integer#MAX_VALUE}.1175*<p>1176* The default implementation will throw {@code UnsupportedOperationException}1177*1178* @return an array of update counts containing one element for each1179* command in the batch. The elements of the array are ordered according1180* to the order in which commands were added to the batch.1181* @exception SQLException if a database access error occurs,1182* this method is called on a closed <code>Statement</code> or the1183* driver does not support batch statements. Throws {@link BatchUpdateException}1184* (a subclass of <code>SQLException</code>) if one of the commands sent to the1185* database fails to execute properly or attempts to return a result set.1186* @throws SQLTimeoutException when the driver has determined that the1187* timeout value that was specified by the {@code setQueryTimeout}1188* method has been exceeded and has at least attempted to cancel1189* the currently running {@code Statement}1190*1191* @see #addBatch1192* @see DatabaseMetaData#supportsBatchUpdates1193* @since 1.81194*/1195default long[] executeLargeBatch() throws SQLException {1196throw new UnsupportedOperationException("executeLargeBatch not implemented");1197}11981199/**1200* Executes the given SQL statement, which may be an <code>INSERT</code>,1201* <code>UPDATE</code>, or <code>DELETE</code> statement or an1202* SQL statement that returns nothing, such as an SQL DDL statement.1203* <p>1204* This method should be used when the returned row count may exceed1205* {@link Integer#MAX_VALUE}.1206* <p>1207* <strong>Note:</strong>This method cannot be called on a1208* <code>PreparedStatement</code> or <code>CallableStatement</code>.1209*<p>1210* The default implementation will throw {@code UnsupportedOperationException}1211*1212* @param sql an SQL Data Manipulation Language (DML) statement,1213* such as <code>INSERT</code>, <code>UPDATE</code> or1214* <code>DELETE</code>; or an SQL statement that returns nothing,1215* such as a DDL statement.1216*1217* @return either (1) the row count for SQL Data Manipulation Language1218* (DML) statements or (2) 0 for SQL statements that return nothing1219*1220* @exception SQLException if a database access error occurs,1221* this method is called on a closed <code>Statement</code>, the given1222* SQL statement produces a <code>ResultSet</code> object, the method is called on a1223* <code>PreparedStatement</code> or <code>CallableStatement</code>1224* @throws SQLTimeoutException when the driver has determined that the1225* timeout value that was specified by the {@code setQueryTimeout}1226* method has been exceeded and has at least attempted to cancel1227* the currently running {@code Statement}1228* @since 1.81229*/1230default long executeLargeUpdate(String sql) throws SQLException {1231throw new UnsupportedOperationException("executeLargeUpdate not implemented");1232}12331234/**1235* Executes the given SQL statement and signals the driver with the1236* given flag about whether the1237* auto-generated keys produced by this <code>Statement</code> object1238* should be made available for retrieval. The driver will ignore the1239* flag if the SQL statement1240* is not an <code>INSERT</code> statement, or an SQL statement able to return1241* auto-generated keys (the list of such statements is vendor-specific).1242* <p>1243* This method should be used when the returned row count may exceed1244* {@link Integer#MAX_VALUE}.1245* <p>1246* <strong>Note:</strong>This method cannot be called on a1247* <code>PreparedStatement</code> or <code>CallableStatement</code>.1248*<p>1249* The default implementation will throw {@code SQLFeatureNotSupportedException}1250*1251* @param sql an SQL Data Manipulation Language (DML) statement,1252* such as <code>INSERT</code>, <code>UPDATE</code> or1253* <code>DELETE</code>; or an SQL statement that returns nothing,1254* such as a DDL statement.1255*1256* @param autoGeneratedKeys a flag indicating whether auto-generated keys1257* should be made available for retrieval;1258* one of the following constants:1259* <code>Statement.RETURN_GENERATED_KEYS</code>1260* <code>Statement.NO_GENERATED_KEYS</code>1261* @return either (1) the row count for SQL Data Manipulation Language (DML) statements1262* or (2) 0 for SQL statements that return nothing1263*1264* @exception SQLException if a database access error occurs,1265* this method is called on a closed <code>Statement</code>, the given1266* SQL statement returns a <code>ResultSet</code> object,1267* the given constant is not one of those allowed, the method is called on a1268* <code>PreparedStatement</code> or <code>CallableStatement</code>1269* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1270* this method with a constant of Statement.RETURN_GENERATED_KEYS1271* @throws SQLTimeoutException when the driver has determined that the1272* timeout value that was specified by the {@code setQueryTimeout}1273* method has been exceeded and has at least attempted to cancel1274* the currently running {@code Statement}1275* @since 1.81276*/1277default long executeLargeUpdate(String sql, int autoGeneratedKeys)1278throws SQLException {1279throw new SQLFeatureNotSupportedException("executeLargeUpdate not implemented");1280}12811282/**1283* Executes the given SQL statement and signals the driver that the1284* auto-generated keys indicated in the given array should be made available1285* for retrieval. This array contains the indexes of the columns in the1286* target table that contain the auto-generated keys that should be made1287* available. The driver will ignore the array if the SQL statement1288* is not an <code>INSERT</code> statement, or an SQL statement able to return1289* auto-generated keys (the list of such statements is vendor-specific).1290* <p>1291* This method should be used when the returned row count may exceed1292* {@link Integer#MAX_VALUE}.1293* <p>1294* <strong>Note:</strong>This method cannot be called on a1295* <code>PreparedStatement</code> or <code>CallableStatement</code>.1296*<p>1297* The default implementation will throw {@code SQLFeatureNotSupportedException}1298*1299* @param sql an SQL Data Manipulation Language (DML) statement,1300* such as <code>INSERT</code>, <code>UPDATE</code> or1301* <code>DELETE</code>; or an SQL statement that returns nothing,1302* such as a DDL statement.1303*1304* @param columnIndexes an array of column indexes indicating the columns1305* that should be returned from the inserted row1306* @return either (1) the row count for SQL Data Manipulation Language (DML) statements1307* or (2) 0 for SQL statements that return nothing1308*1309* @exception SQLException if a database access error occurs,1310* this method is called on a closed <code>Statement</code>, the SQL1311* statement returns a <code>ResultSet</code> object,the second argument1312* supplied to this method is not an1313* <code>int</code> array whose elements are valid column indexes, the method is called on a1314* <code>PreparedStatement</code> or <code>CallableStatement</code>1315* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method1316* @throws SQLTimeoutException when the driver has determined that the1317* timeout value that was specified by the {@code setQueryTimeout}1318* method has been exceeded and has at least attempted to cancel1319* the currently running {@code Statement}1320* @since 1.81321*/1322default long executeLargeUpdate(String sql, int columnIndexes[]) throws SQLException {1323throw new SQLFeatureNotSupportedException("executeLargeUpdate not implemented");1324}13251326/**1327* Executes the given SQL statement and signals the driver that the1328* auto-generated keys indicated in the given array should be made available1329* for retrieval. This array contains the names of the columns in the1330* target table that contain the auto-generated keys that should be made1331* available. The driver will ignore the array if the SQL statement1332* is not an <code>INSERT</code> statement, or an SQL statement able to return1333* auto-generated keys (the list of such statements is vendor-specific).1334* <p>1335* This method should be used when the returned row count may exceed1336* {@link Integer#MAX_VALUE}.1337* <p>1338* <strong>Note:</strong>This method cannot be called on a1339* <code>PreparedStatement</code> or <code>CallableStatement</code>.1340*<p>1341* The default implementation will throw {@code SQLFeatureNotSupportedException}1342*1343* @param sql an SQL Data Manipulation Language (DML) statement,1344* such as <code>INSERT</code>, <code>UPDATE</code> or1345* <code>DELETE</code>; or an SQL statement that returns nothing,1346* such as a DDL statement.1347* @param columnNames an array of the names of the columns that should be1348* returned from the inserted row1349* @return either the row count for <code>INSERT</code>, <code>UPDATE</code>,1350* or <code>DELETE</code> statements, or 0 for SQL statements1351* that return nothing1352* @exception SQLException if a database access error occurs,1353* this method is called on a closed <code>Statement</code>, the SQL1354* statement returns a <code>ResultSet</code> object, the1355* second argument supplied to this method is not a <code>String</code> array1356* whose elements are valid column names, the method is called on a1357* <code>PreparedStatement</code> or <code>CallableStatement</code>1358* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method1359* @throws SQLTimeoutException when the driver has determined that the1360* timeout value that was specified by the {@code setQueryTimeout}1361* method has been exceeded and has at least attempted to cancel1362* the currently running {@code Statement}1363* @since 1.81364*/1365default long executeLargeUpdate(String sql, String columnNames[])1366throws SQLException {1367throw new SQLFeatureNotSupportedException("executeLargeUpdate not implemented");1368}1369}137013711372