001/*
002 * ============================================================================
003 *  Copyright © 2002-2024 by Thomas Thrien.
004 *  All Rights Reserved.
005 * ============================================================================
006 *  Licensed to the public under the agreements of the GNU Lesser General Public
007 *  License, version 3.0 (the "License"). You may obtain a copy of the License at
008 *
009 *       http://www.gnu.org/licenses/lgpl.html
010 *
011 *  Unless required by applicable law or agreed to in writing, software
012 *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
013 *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
014 *  License for the specific language governing permissions and limitations
015 *  under the License.
016 */
017
018package org.tquadrat.foundation.sql;
019
020import static org.apiguardian.api.API.Status.STABLE;
021
022import java.io.InputStream;
023import java.io.Reader;
024import java.math.BigDecimal;
025import java.net.URL;
026import java.sql.Array;
027import java.sql.BatchUpdateException;
028import java.sql.Blob;
029import java.sql.Clob;
030import java.sql.Connection;
031import java.sql.Date;
032import java.sql.JDBCType;
033import java.sql.NClob;
034import java.sql.Ref;
035import java.sql.ResultSet;
036import java.sql.ResultSetMetaData;
037import java.sql.RowId;
038import java.sql.SQLException;
039import java.sql.SQLFeatureNotSupportedException;
040import java.sql.SQLOutput;
041import java.sql.SQLTimeoutException;
042import java.sql.SQLType;
043import java.sql.SQLWarning;
044import java.sql.SQLXML;
045import java.sql.Time;
046import java.sql.Timestamp;
047import java.util.Calendar;
048import java.util.List;
049import java.util.function.BooleanSupplier;
050
051import org.apiguardian.api.API;
052import org.tquadrat.foundation.annotation.ClassVersion;
053import org.tquadrat.foundation.sql.internal.EnhancedPreparedStatementImpl;
054
055/**
056 *  <p>{@summary The definition of an enhanced
057 *  {@link java.sql.PreparedStatement}.}</p>
058 *  <p>The implementation of this interface wraps an instance of
059 *  {@code PreparedStatement} and provides solutions for three issues that the
060 *  original definition has:</p>
061 *  <ol>
062 *    <li>The placeholders in a prepared statement are only identified by their
063 *    position, and it is quite easy to mix those positions up, especially when
064 *    modifying the statement. This can cause errors during runtime that are
065 *    very difficult to detect.</li>
066 *    <li>The fact that the placeholders are only position based causes another
067 *    inconvenience. Assume an SQL statement like that one below:
068 *    <pre><code>    SELECT *
069 *    FROM table1,table2
070 *    WHERE table1.key = table2.key
071 *          AND table1.value &lt; ?
072 *          AND table2.value &gt; ?</code></pre>
073 *    where the question mark stands for the same value. This would require to
074 *    call
075 *    {@link java.sql.PreparedStatement#setInt(int, int) setInt()}
076 *    twice, with the same value, but a different position index.</li>
077 *    <li>{@code PreparedStatement} does not allow to log the SQL statement
078 *    together with the assigned values for the placeholders; at least this is
079 *    not defined in the interface itself; some vendor specific implementations
080 *    may provide such an additional API, but there is no generic one. An
081 *    implementation of this interface takes a method that can write any
082 *    executed SQL statement to a logger.</li>
083 *  </ol>
084 *
085 *  @note The interface {@code EnhancedPreparedStatement} does not extends the
086 *      interface {@code java.sql.PreparedStatement}!
087 *
088 *  @extauthor Thomas Thrien - thomas.thrien@tquadrat.org
089 *  @version $Id: EnhancedPreparedStatement.java 1091 2024-01-25 23:10:08Z tquadrat $
090 *  @since 0.1.0
091 *
092 *  @UMLGraph.link
093 *
094 *  @see    java.sql.PreparedStatement
095 */
096@SuppressWarnings( {"ClassWithTooManyMethods", "OverlyComplexClass"} )
097@ClassVersion( sourceVersion = "$Id: EnhancedPreparedStatement.java 1091 2024-01-25 23:10:08Z tquadrat $" )
098@API( status = STABLE, since = "0.1.0" )
099public sealed interface EnhancedPreparedStatement extends AutoCloseable
100    permits org.tquadrat.foundation.sql.internal.EnhancedPreparedStatementBase
101{
102        /*---------------*\
103    ====** Inner Classes **====================================================
104        \*---------------*/
105    /**
106     *  <p>{@summary The definition of logger method for a
107     *  {@link java.sql.PreparedStatement}.}</p>
108     *  <p>This is a functional interface whose functional method is
109     *  {@link #log(String,String,List,StackTraceElement[])}.</p>
110     *
111     *  @extauthor Thomas Thrien - thomas.thrien@tquadrat.org
112     *  @version $Id: EnhancedPreparedStatement.java 1091 2024-01-25 23:10:08Z tquadrat $
113     *  @since 0.1.0
114     *
115     *  @UMLGraph.link
116     *
117     *  @see    java.sql.PreparedStatement
118     */
119    @SuppressWarnings( "InnerClassOfInterface" )
120    @ClassVersion( sourceVersion = "$Id: EnhancedPreparedStatement.java 1091 2024-01-25 23:10:08Z tquadrat $" )
121    @API( status = STABLE, since = "0.1.0" )
122    @FunctionalInterface
123    public interface StatementLogger
124    {
125        /**
126         *  Provides the logging information.
127         *
128         *  @param  operation   The name of the operation that logs.
129         *  @param  statement   The source of the prepared statement.
130         *  @param  values  The values.
131         *  @param  stackTrace  The stacktrace; can be {@code null}.
132         */
133        @SuppressWarnings( "MethodCanBeVariableArityMethod" )
134        public void log( final String operation, final String statement, final List<String> values, final StackTraceElement [] stackTrace );
135    }
136    //  interface StatementLogger
137
138        /*-----------*\
139    ====** Constants **========================================================
140        \*-----------*/
141    /**
142     *  The regular expression that is used to identify a named parameter in
143     *  the SQL statement text: {@value}.
144     *
145     *  @see    #prepareStatement(Connection,String)
146     */
147    public static final String VARIABLE_PATTERN = "[^:](:[a-zA-Z][a-zA-Z0-9]*)";
148
149        /*---------*\
150    ====** Methods **==========================================================
151        \*---------*/
152    /**
153     *  Adds a set of parameters to this {@code EnhancedPreparedStatement}
154     *  instance's batch of commands.
155     *
156     *  @throws SQLException    A database access error occurred or this method
157     *      was called on a closed {@code EnhancedPreparedStatement}.
158     *
159     *  @see    java.sql.Statement#addBatch(String)
160     */
161    public void addBatch() throws SQLException;
162
163    /**
164     *  <p>{@summary Cancels this {@code EnhancedPreparedStatement} object if
165     *  both the DBMS and driver support aborting an SQL statement.}</p>
166     *  <p>This method can be used by one thread to cancel a statement that
167     *  is being executed by another thread.</p>
168     *
169     *  @throws SQLException    A database access error occurred or this method
170     *      was called on a closed {@code EnhancedPreparedStatement}.
171     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
172     *      support this method.
173     */
174    void cancel() throws SQLException;
175
176    /**
177     *  Empties this {@code EnhancedPreparedStatement} instance's current list
178     *  of SQL commands.
179     *
180     *  @throws SQLException    A database access error occurred, this method
181     *      was called on a closed {@code EnhancedPreparedStatement}, or the
182     *      driver does not support batch updates.
183     *
184     *  @see    #addBatch()
185     *  @see    java.sql.DatabaseMetaData#supportsBatchUpdates()
186     */
187    public void clearBatch() throws SQLException;
188
189    /**
190     *  <p>{@summary Clears the current parameter values immediately.}</p>
191     *  <p>In general, parameter values remain in force for repeated use of a
192     *  statement. Setting a parameter value automatically clears its previous
193     *  value. However, in some cases it is useful to immediately release the
194     *  resources used by the current parameter values; this can be done by
195     *  calling the method {@code clearParameters()}.
196     *
197     *  @throws SQLException    A database access error occurred or this method
198     *      was called on a closed {@code EnhancedPreparedStatement}.
199     */
200    public void clearParameters() throws SQLException;
201
202    /**
203     *  <p>{@summary Clears all the warnings reported on this
204     *  {@code EnhancedPreparedStatement} instance.} After a call to this
205     *  method, the method
206     *  {@link #getWarnings()}
207     *  will return {@code null} until a new warning is reported for this
208     *  {@code EnhancedPreparedStatement} instance.</p>
209     *
210     *  @throws SQLException    A database access error occurred or this method
211     *      was called on a closed {@code EnhancedPreparedStatement}.
212     */
213    public void clearWarnings() throws SQLException;
214
215    /**
216     *  <p>{@summary Releases this instance's database and JDBC resources
217     *  immediately instead of waiting for this to happen when it is
218     *  automatically closed.} It is generally good practice to release
219     *  resources as soon as you are finished with them to avoid tying up
220     *  database resources.</p>
221     *  <p>Calling the method {@code close} on a
222     *  {@code EnhancedPreparedStatement} object that is already closed has no
223     *  effect.</p>
224     *
225     *  @note   When a {@code EnhancedPreparedStatement} instance is closed,
226     *      its current {@code ResultSet} instance, if one exists, is also
227     *      closed.
228     *
229     *  @throws SQLException    A database access error occurred.
230     */
231    @Override
232    public void close() throws SQLException;
233
234    /**
235     *  <p>{@summary Specifies that this {@code EnhancedPreparedStatement} will
236     *  be closed when all its dependent result sets are closed.} If the
237     *  execution of the {@code EnhancedPreparedStatement} does not produce
238     *  any result sets, this method has no effect.</p>
239     *
240     *  @note   Multiple calls to {@code closeOnCompletion()} do not toggle the
241     *      effect on this {@code EnhancedPreparedStatement}. However, a call
242     *      to {@code closeOnCompletion()} does affect both the subsequent
243     *      execution of statements, and statements that currently have open,
244     *      dependent, result sets.
245     *
246     *  @throws SQLException    This method was called on a closed
247     *      {@code EnhancedPreparedStatement}.
248     */
249    public void closeOnCompletion() throws SQLException;
250
251    /**
252     *  <p>{@summary Enables the logging output for the
253     *  {@code EnhancedPreparedStatement} instances.}</p>
254     *  <p>The {@code logger} method takes three arguments:</p>
255     *  <ol>
256     *      <li>{@code operation} – The name of the operation that logs.</li>
257     *      <li>{@code statement} – The source of the prepared statement.</li>
258     *      <li>{@code values} – A list of the values in the format
259     *      <pre><code>&lt;<i>name</i>&gt;<b> [</b>&lt;<i>type</i>&gt;<b>]:&lt;<i>value</i>&gt;</b></code></pre>
260     *      A type of {@code NULL} indicates an unknown type; for large values (like
261     *      {@link java.sql.Blob}
262     *      or
263     *      {@link java.io.Reader})
264     *      only the class is given instead of the real value.</li>
265     *      <li>{@code stacktrace} – The stacktrace; will be {@code null} if
266     *      {@code addStacktrace} is {@code false}.</li>
267     *  </ol>
268     *  <p>The {@code logCheck} method returns {@code true} only when logging
269     *  should be done. No information is collected while it returns
270     *  {@code false}. As the method is called for nearly any operation, its
271     *  implementation should be as efficient as possible.</p>
272     *
273     *  @param  logger  The method that takes the logging information.
274     *  @param  logCheck    The method that returns a flag whether log output
275     *      is desired.
276     *  @param  addStacktrace   {@code true} if the stacktrace should be added
277     *      to the log output.
278     */
279    public static void enableLogging( final StatementLogger logger, final BooleanSupplier logCheck, final boolean addStacktrace )
280    {
281        EnhancedPreparedStatementImpl.enableLogging( logger, logCheck, addStacktrace );
282    }   //  enableLogging()
283
284    /**
285     *  <p>{@summary Returns a SQL identifier.} If {@code identifier} is a
286     *  simple SQL identifier:</p>
287     *  <ul>
288     *      <li>Return the original value if {@code alwaysQuote} is
289     *      {@code false}</li>
290     *      <li>Return a delimited identifier if {@code alwaysQuote} is
291     *      {@code true}</li>
292     *  </ul>
293     *  <p>If {@code identifier} is not a simple SQL identifier,
294     *  {@code identifier} will be enclosed in double quotes if not already
295     *  present. If the datasource does not support double quotes for delimited
296     *  identifiers, the identifier should be enclosed by the string returned
297     *  from
298     *  {@link java.sql.DatabaseMetaData#getIdentifierQuoteString}.
299     *  If the datasource does not support delimited identifiers, a
300     *  {@code SQLFeatureNotSupportedException} should be thrown.</p>
301     *  <p>A {@code SQLException} will be thrown if {@code identifier} contains
302     *  any characters invalid in a delimited identifier or the identifier
303     *  length is invalid for the datasource.</p>
304     *
305     *  @param  identifier  An SQL identifier.
306     *  @param  alwaysQuote Indicates if a simple SQL identifier should be
307     *      returned as a quoted identifier.
308     *  @return A simple SQL identifier or a delimited identifier
309     *  @throws SQLException    The identifier was not a valid identifier.
310     *  @throws SQLFeatureNotSupportedException The datasource does not support
311     *      delimited identifiers.
312     *  @throws NullPointerException    The identifier was {@code null}.
313     */
314    public String enquoteIdentifier(String identifier, boolean alwaysQuote) throws SQLException;
315
316
317    /**
318     *  <p>{@summary Returns a {@code String} enclosed in single quotes.} Any
319     *  occurrence of a single quote within the string will be replaced by two
320     *  single quotes.</p>
321     *
322     *  <blockquote>
323     *      <table class="striped">
324     *          <caption>Examples of the conversion:</caption>
325     *          <thead>
326     *              <tr>
327     *                  <th scope="col">Value</th>
328     *                  <th scope="col">Result</th>
329     *              </tr>
330     *          </thead>
331     *          <tbody style="text-align:center">
332     *              <tr>
333     *                  <th scope="row">Hello</th>
334     *                  <td>'Hello'</td>
335     *              </tr>
336     *              <tr>
337     *                  <th scope="row">G'Day</th>
338     *                  <td>'G''Day'</td>
339     *              </tr>
340     *              <tr>
341     *                  <th scope="row">'G''Day'</th>
342     *                  <td>'''G''''Day'''</td>
343     *              </tr>
344     *              <tr>
345     *                  <th scope="row">I'''M</th>
346     *                  <td>'I''''''M'</td>
347     *              </tr>
348     *          </tbody>
349     *      </table>
350     *  </blockquote>
351     *
352     *  @param  value A character String.
353     *  @return A string enclosed by single quotes with every single quote
354     *      converted to two single quotes
355     *  @throws NullPointerException    The {@code value} argument was
356     *      {@code null}.
357     *  @throws SQLException    A database access error occurred.
358     */
359    public String enquoteLiteral( String value ) throws SQLException;
360
361    /**
362     *  <p>{@summary Returns a {@code String} representing a National Character
363     *  Set Literal enclosed in single quotes and prefixed with a upper case
364     *  letter {@code N}.} Any occurrence of a single quote within the string
365     *  will be replaced by two single quotes.</p>
366     *
367     *  <blockquote>
368     *    <table class="striped">
369     *      <caption>Examples of the conversion:</caption>
370     *      <thead>
371     *        <tr>
372     *          <th scope="col">Value</th>
373     *          <th scope="col">Result</th>
374     *        </tr>
375     *      </thead>
376     *      <tbody>
377     *        <tr>
378     *          <th scope="row">Hello</th>
379     *          <td>N'Hello'</td>
380     *        </tr>
381     *        <tr>
382     *          <th scope="row">G'Day</th>
383     *          <td>N'G''Day'</td>
384     *        </tr>
385     *        <tr>
386     *          <th scope="row">'G''Day'</th>
387     *          <td>N'''G''''Day'''</td>
388     *        </tr>
389     *        <tr>
390     *          <th scope="row">I'''M</th>
391     *          <td>N'I''''''M'</td>
392     *        </tr>
393     *        <tr>
394     *          <th scope="row">N'Hello'</th>
395     *          <td>N'N''Hello'''</td>
396     *        </tr>
397     *      </tbody>
398     *    </table>
399     *  </blockquote>
400     *
401     *  @param  s   A character string
402     *  @return The result of replacing every single quote character in the
403     *      argument by two single quote characters where this entire result is
404     *      then prefixed with 'N'.
405     *  @throws SQLException    A database access error occurred.
406     *
407     *  @see java.sql.Statement#enquoteNCharLiteral(String)
408     */
409    public String enquoteNCharLiteral( String s ) throws SQLException;
410
411    /**
412     *  <p>{@summary Executes the SQL statement in this
413     *  {@code PreparedStatement} object, which may be any kind of SQL
414     *  statement.}</p>
415     *  <p>Some prepared statements return multiple results; the
416     *  {@code execute()} method handles these complex statements as well as
417     *  the simpler form of statements handled by the methods
418     *  {@link #executeQuery()}
419     *  and
420     *  {@link #executeUpdate()}.</p>
421     *  <p>The {@code execute()} method returns a {@code boolean} to indicate
422     *  the form of the first result. You must call either the method
423     *  {@link #getResultSet()}
424     *  or
425     *  {@link #getUpdateCount()}
426     *  to retrieve the result; you must call
427     *  {@link #getMoreResults()}
428     *  to move to any subsequent result(s).</p>
429     *
430     *  @return {@code true} if the first result is a
431     *      {@link ResultSet}
432     *      instance; {@code false} if the first result is an update count or
433     *      there is no result.
434     *  @throws SQLException    A database access error occurred, this method
435     *      was called on a closed {@code EnhancedPreparedStatement} or no
436     *      argument was supplied for at least one parameter.
437     *  @throws SQLTimeoutException The driver determined that the timeout
438     *      value that was specified by the
439     *      {@link #setQueryTimeout(int)}
440     *      method has been exceeded and has at least attempted to cancel the
441     *      currently running
442     *      {@link java.sql.Statement}.
443     *
444     *  @see    java.sql.Statement#execute
445     *  @see    #getResultSet()
446     *  @see    #getUpdateCount()
447     *  @see    #getMoreResults()
448     */
449    @SuppressWarnings( "BooleanMethodNameMustStartWithQuestion" )
450    public boolean execute() throws SQLException;
451
452    /**
453     *  <p>{@summary Submits a batch of commands to the database for execution
454     *  and if all commands execute successfully, returns an array of update
455     *  counts.} The {@code int} elements of the array that is returned are
456     *  ordered to correspond to the commands in the batch, which are ordered
457     *  according to the order in which they were added to the batch.</p>
458     *  <p>The elements in the array returned by the method
459     *  {@code executeBatch()} may be one of the following:</p>
460     *  <ol>
461     *      <li>A number greater than or equal to zero – indicates that the
462     *      command was processed successfully and is an update count giving
463     *      the number of rows in the database that were affected by the
464     *      command's execution.</li>
465     *      <li>A value of
466     *      {@link java.sql.Statement#SUCCESS_NO_INFO}
467     *      ({@value java.sql.Statement#SUCCESS_NO_INFO} – indicates that the
468     *      command was processed successfully but that the number of rows
469     *      affected is unknown.</li>
470     *  </ol>
471     *  <p>If one of the commands in a batch update fails to execute properly,
472     *  this method throws a
473     *  {@link BatchUpdateException},
474     *  and a JDBC driver may or may not continue to process the remaining
475     *  commands in the batch. However, the driver's behaviour must be
476     *  consistent with a particular DBMS, either always continuing to process
477     *  commands or never continuing to process commands. If the driver
478     *  continues processing after a failure, the array returned by the method
479     *  {@link BatchUpdateException#getUpdateCounts()}
480     *  will contain as many elements as there are commands in the batch, and
481     *  at least one of the elements will be
482     *  {@link java.sql.Statement#EXECUTE_FAILED}
483     *  ({@value java.sql.Statement#EXECUTE_FAILED} – indicating that the
484     *  command failed to execute successfully); it occurs only if a driver
485     *  continues to process commands after a command failed.</p>
486     *
487     *  @note    The possible implementations and return values have been
488     *  modified in the Java 2 SDK, Standard Edition, version 1.3 to
489     *  accommodate the option of continuing to process commands in a batch
490     *  update after a {@code BatchUpdateException} object has been thrown.
491     *
492     *  @return An array of update counts containing one element for each
493     *      command in the batch. The elements of the array are ordered
494     *      according to the order in which commands were added to the batch.
495     *  @throws SQLException    A database access error occurred, this method
496     *      was called on a closed {@code EnhancedPreparedStatement} or the
497     *      driver does not support batch statements.
498     *  @throws BatchUpdateException    One of the commands sent to the
499     *      database failed to execute properly or attempts to return a result
500     *      set.
501     *  @throws SQLTimeoutException The driver determined that the timeout
502     *      value that was specified by a call to
503     *      {@link #setQueryTimeout(int)}
504     *      was exceeded and at least attempted to cancel the currently running
505     *      statement.
506     *
507     *  @see    #addBatch()
508     *  @see    java.sql.DatabaseMetaData#supportsBatchUpdates
509     */
510    public int[] executeBatch() throws SQLException;
511
512    /**
513     *  <p>{@summary Submits a batch of commands to the database for execution
514     *  and if all commands execute successfully, returns an array of update
515     *  counts.} The {@code int} elements of the array that is returned are
516     *  ordered to correspond to the commands in the batch, which are ordered
517     *  according to the order in which they were added to the batch.</p>
518     *  <p>The elements in the array returned by the method
519     *  {@code executeBatch()} may be one of the following:</p>
520     *  <ol>
521     *      <li>A number greater than or equal to zero – indicates that the
522     *      command was processed successfully and is an update count giving
523     *      the number of rows in the database that were affected by the
524     *      command's execution.</li>
525     *      <li>A value of
526     *      {@link java.sql.Statement#SUCCESS_NO_INFO}
527     *      ({@value java.sql.Statement#SUCCESS_NO_INFO} – indicates that the
528     *      command was processed successfully but that the number of rows
529     *      affected is unknown.</li>
530     *  </ol>
531     *  <p>If one of the commands in a batch update fails to execute properly,
532     *  this method throws a
533     *  {@link BatchUpdateException},
534     *  and a JDBC driver may or may not continue to process the remaining
535     *  commands in the batch. However, the driver's behaviour must be
536     *  consistent with a particular DBMS, either always continuing to process
537     *  commands or never continuing to process commands. If the driver
538     *  continues processing after a failure, the array returned by the method
539     *  {@link BatchUpdateException#getLargeUpdateCounts()}
540     *  will contain as many elements as there are commands in the batch, and
541     *  at least one of the elements will be
542     *  {@link java.sql.Statement#EXECUTE_FAILED}
543     *  ({@value java.sql.Statement#EXECUTE_FAILED} – indicating that the
544     *  command failed to execute successfully); it occurs only if a driver
545     *  continues to process commands after a command failed.</p>
546     *  <p>This method should be used when the returned row count may exceed
547     *  {@link Integer#MAX_VALUE}.</p>
548     *
549     *  @return An array of update counts containing one element for each
550     *      command in the batch. The elements of the array are ordered
551     *      according to the order in which commands were added to the batch.
552     *  @throws SQLException    A database access error occurred, this method
553     *      was called on a closed {@code EnhancedPreparedStatement} or the
554     *      driver does not support batch statements.
555     *  @throws BatchUpdateException    One of the commands sent to the
556     *      database failed to execute properly or attempts to return a result
557     *      set.
558     *  @throws SQLTimeoutException The driver determined that the timeout
559     *      value that was specified by a call to
560     *      {@link #setQueryTimeout(int)}
561     *      was exceeded and at least attempted to cancel the currently running
562     *      statement.
563     *
564     *  @see    #addBatch()
565     *  @see    #executeBatch()
566     *  @see    java.sql.Statement#executeLargeBatch()
567     *  @see    java.sql.DatabaseMetaData#supportsBatchUpdates
568     */
569    public long[] executeLargeBatch() throws SQLException;
570
571    /**
572     *  <p>{@summary Executes the SQL statement in this
573     *  {@code EnhancedPreparedStatement} instance.} It must be an SQL Data
574     *  Manipulation Language (DML) statement, such as {@code INSERT},
575     *  {@code UPDATE} or {@code DELETE}; or an SQL statement that returns
576     *  nothing, such as a DDL statement.</p>
577     *  <p>This method should be used when the returned row count may exceed
578     *  {@link Integer#MAX_VALUE}.</p>
579     *  <p>The default implementation will throw
580     *  {@link UnsupportedOperationException}.</p>
581     *
582     *  @return Either the row count for SQL Data Manipulation Language (DML)
583     *      statements or 0 for SQL statements that return nothing.
584     *  @throws SQLException    A database access error occurred, this method
585     *      was called on a closed {@code EnhancedPreparedStatement} or the SQL
586     *      statement returns a
587     *      {@link ResultSet}
588     *      object.
589     *  @throws SQLTimeoutException The driver determined that the timeout
590     *      value that was specified by the
591     *      {@link #setQueryTimeout(int)}
592     *      method has been exceeded and has at least attempted to cancel the
593     *      currently running
594     *      {@link java.sql.Statement}.
595     */
596    public long executeLargeUpdate() throws SQLException;
597
598    /**
599     *  <p>{@summary Executes the SQL query in this {@code PreparedStatement}
600     *  object and returns the
601     *  {@link ResultSet}
602     *  object generated by the query.}</p>
603     *
604     *  @return A
605     *      {@link ResultSet}
606     *      instance that contains the data produced by the query; never
607     *      {@code null}.
608     *  @throws SQLException    A database access error occurred, this method
609     *      was called on a closed {@code EnhancedPreparedStatement} or the SQL
610     *      statement did not return a {@code ResultSet} object.
611     *  @throws SQLTimeoutException The driver determined that the timeout
612     *      value that was specified by the
613     *      {@link #setQueryTimeout(int)}
614     *      method has been exceeded and has at least attempted to cancel the
615     *      currently running
616     *      {@link java.sql.Statement}.
617     */
618    public ResultSet executeQuery() throws SQLException;
619
620    /**
621     *  <p>{@summary Executes the SQL statement in this
622     *  {@code EnhancedPreparedStatement} instance.} It must be an SQL Data
623     *  Manipulation Language (DML) statement, such as {@code INSERT},
624     *  {@code UPDATE} or {@code DELETE}; or an SQL statement that returns
625     *  nothing, such as a DDL statement.</p>
626     *
627     *  @return Either the row count for SQL Data Manipulation Language (DML)
628     *      statements or 0 for SQL statements that return nothing.
629     *  @throws SQLException    A database access error occurred, this method
630     *      was called on a closed {@code EnhancedPreparedStatement} or the SQL
631     *      statement returns a
632     *      {@link ResultSet}
633     *      object.
634     *  @throws SQLTimeoutException The driver determined that the timeout
635     *      value that was specified by the
636     *      {@link #setQueryTimeout(int)}
637     *      method has been exceeded and has at least attempted to cancel the
638     *      currently running
639     *      {@link java.sql.Statement}.
640     */
641    public int executeUpdate() throws SQLException;
642
643    /**
644     *  <p>{@summary Retrieves the
645     *  {@link Connection}
646     *  instance that produced the
647     *  {@link java.sql.PreparedStatement}
648     *  instance wrapped by this {@code EnhancedPreparedStatement}.}</p>
649     *
650     *  @return The connection that produced the wrapped prepared statement.
651     *  @throws SQLException    A database access error occurred or this method
652     *      was called on a closed {@code EnhancedPreparedStatement}.
653     */
654    public Connection getConnection()  throws SQLException;
655
656    /**
657     *  <p>{@summary Retrieves the direction for fetching rows from database
658     *  tables that is the default for result sets generated from this
659     *  {@code EnhancedPreparedStatement} instance.}</p>
660     *  <p>If this {@code EnhancedPreparedStatement} instance has not set a
661     *  fetch direction by calling the method
662     *  {@link #setFetchDirection(int)},
663     *  the return value is implementation-specific.</p>
664     *
665     *  @return The default fetch direction for result sets generated from this
666     *      {@code EnhancedPreparedStatement} instance.
667     *  @throws SQLException    A database access error occurred or this method
668     *      was called on a closed {@code EnhancedPreparedStatement}.
669     *
670     *  @see    #setFetchDirection(int)
671     */
672    public int getFetchDirection() throws SQLException;
673
674    /**
675     *  <p>{@summary Retrieves the number of result set rows that is the
676     *  default fetch size for
677     *  {@link java.sql.ResultSet}
678     *  instances generated from this {@code EnhancedPreparedStatement}
679     *  instance.} If this statement instance has not set a fetch size by
680     *  calling the method
681     *  {@link #setFetchSize(int)},
682     *  the return value is implementation-specific.</p>
683     *
684     *  @return The default fetch size for result sets generated from this
685     *      {@code EnhancedPreparedStatement} instance.
686     *  @throws SQLException    A database access error occurred or this method
687     *      was called on a closed {@code EnhancedPreparedStatement}.
688     *
689     *  @see    #setFetchSize(int)
690     */
691    public int getFetchSize() throws SQLException;
692
693    /**
694     *  <p>{@summary Retrieves any auto-generated keys created as a result of
695     *  executing this {@code EnhancedPreparedStatement} instance.} If this
696     *  statement did not generate any keys, an empty
697     *  {@link java.sql.ResultSet}
698     *  object is returned.</p>
699     *
700     *  @note   If the columns which represent the auto-generated keys were not
701     *      specified, the JDBC driver implementation will determine the
702     *      columns which best represent the auto-generated keys.
703     *
704     *  @return A {@code ResultSet} instance containing the auto-generated
705     *      key(s) generated by the execution of this
706     *      {@code EnhancedPreparedStatement} instance.
707     *  @throws SQLException    A database access error occurred or this method
708     *      was called on a closed {@code Statement}.
709     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
710     *      support this method.
711     */
712    public ResultSet getGeneratedKeys() throws SQLException;
713
714    /**
715     *  <p>{@summary Retrieves the maximum number of rows that a
716     *  {@link ResultSet}
717     *  instance produced by this {@code EnhancedPreparedStatement} instance
718     *  can contain.} If this limit is exceeded, the excess rows are silently
719     *  dropped.</p>
720     *  <p>This method should be used when the returned row limit may exceed
721     *  {@link Integer#MAX_VALUE}.</p>
722     *  <p>The default implementation will return {@code 0}.</p>
723     *
724     *  @return The current maximum number of rows for a {@code ResultSet}
725     *      instance produced by this {@code EnhancedPreparedStatement}
726     *      instance; zero means there is no limit, or that the method is not
727     *      supported by the JDBC driver.
728     *  @throws SQLException    A database access error occurred or this method
729     *      was called on a closed {@code EnhancedPreparedStatement}.
730     *
731     *  @see    #getMaxRows()
732     *  @see    #setMaxRows(int)
733     *  @see    #setLargeMaxRows(long)
734      */
735    public long getLargeMaxRows() throws SQLException;
736
737    /**
738     *  <p>{@summary Retrieves the current result as an update count.} If the
739     *  result is a
740     *  {@link ResultSet}
741     *  object or there are no more results, -1 is returned.</p>
742     *  <p>This method should be used when the returned row count may exceed
743     *  {@link Integer#MAX_VALUE}.</p>
744     *  <p>The default implementation will throw
745     *  {@link UnsupportedOperationException}</p>
746     *
747     *  @return The current result as an update count; -1 if the current result
748     *      is a {@code ResultSet} object or there are no more results.
749     *  @throws SQLException    A database access error occurred or this method
750     *      was called on a closed {@code EnhancedPreparedStatement}.
751     *
752     *  @see    #execute()
753     */
754    public long getLargeUpdateCount() throws SQLException;
755
756    /**
757     *  <p>{@summary Retrieves the maximum number of bytes that can be
758     *  returned for character and binary column values in a
759     *  {@link ResultSet}
760     *  object produced by this {@code EnhancedPreparedStatement} object.}</p>
761     *  <p>This limit applies only to
762     *  {@link java.sql.JDBCType#BINARY},
763     *  {@link java.sql.JDBCType#VARBINARY},
764     *  {@link java.sql.JDBCType#LONGVARBINARY},
765     *  {@link java.sql.JDBCType#CHAR},
766     *  {@link java.sql.JDBCType#VARCHAR},
767     *  {@link java.sql.JDBCType#NCHAR},
768     *  {@link java.sql.JDBCType#NVARCHAR},
769     *  {@link java.sql.JDBCType#LONGNVARCHAR}
770     *  and
771     *  {@link java.sql.JDBCType#LONGVARCHAR}
772     *  columns. If the limit is exceeded, the excess data is silently
773     *  discarded.</p>
774     *
775     *  @return The current column size limit for columns storing character and
776     *      binary values; zero means there is no limit.
777     *  @throws SQLException    A database access error occurred or this method
778     *      was called on a closed {@code EnhancedPreparedStatement}
779     *
780     *  @see    #setMaxFieldSize(int)
781     */
782    public int getMaxFieldSize() throws SQLException;
783
784    /**
785     *  <p>{@summary Retrieves the maximum number of rows that a
786     *  {@link ResultSet}
787     *  instance produced by this {@code EnhancedPreparedStatement} instance
788     *  can contain.} If this limit is exceeded, the excess rows are silently
789     *  dropped.</p>
790     *
791     *  @return The current maximum number of rows for a {@code ResultSet}
792     *      instance produced by this {@code EnhancedPreparedStatement}
793     *      instance; zero means there is no limit.
794     *  @throws SQLException    A database access error occurred or this method
795     *      was called on a closed {@code EnhancedPreparedStatement}.
796     *
797     *  @see    #getLargeMaxRows()
798     *  @see    #setMaxRows(int)
799     *  @see    #setLargeMaxRows(long)
800     */
801    public int getMaxRows() throws SQLException;
802
803    /**
804     *  <p>{@summary Retrieves a
805     *  {@link ResultSetMetaData}
806     *  object that contains information about the columns of the
807     *  {@link ResultSet}
808     *  instance that will be returned when this
809     *  {@code EnhancedPreparedStatement}
810     *  instance is executed.}</p>
811     *  <p>Because the
812     *  {@link java.sql.PreparedStatement}
813     *  that is wrapped by this {@code EnhancedPreparedStatement} is
814     *  precompiled, it is possible to know about the {@code ResultSet} object
815     *  that it will return without having to execute it. Consequently, it is
816     *  possible to invoke the method {@code getMetaData()} on a
817     *  {@code EnhancedPreparedStatement} instance rather than waiting to
818     *  execute it and then invoking the
819     *  {@link java.sql.ResultSet#getMetaData()}
820     *  method on the {@code ResultSet} instance that is returned.</p>
821     *
822     *  @note   Using this method may be expensive for some drivers due to the
823     *      lack of underlying DBMS support.
824     *
825     *  @return The description of a {@code ResultSet} object's columns or
826     *      {@code null} if the driver cannot return a
827     *      {@code ResultSetMetaData} object.
828     *  @throws SQLException    A database access error occurred or this method
829     *      was called on a closed {@code PreparedStatement}.
830     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
831     *      support this method.
832     */
833    public ResultSetMetaData getMetaData() throws SQLException;
834
835    /**
836     *  <p>{@summary Moves to this {@code EnhancedPreparedStatement} instance's
837     *  next result, returns {@code true} if it is a
838     *  {@link ResultSet}
839     *  instance, and implicitly closes any current {@code ResultSet}
840     *  instance(s) previously obtained with the method
841     *  {@link #getResultSet()}.}</p>
842     *  <p>There are no more results when the following is true:</p>
843     *  <pre><code>
844     *     // stmt is a EnhancedPreparedStatement object
845     *     ((stmt.getMoreResults() == false) &amp;&amp; (stmt.getUpdateCount() == -1))
846     *  </code></pre>
847     *
848     *  @return {@code true} if the next result is a {@code ResultSet}
849     *      instance; {@code false} if it is an update count or there are no
850     *      more results.
851     *  @throws SQLException    A database access error occurred or this method
852     *      was called on a closed {@code EnhancedPreparedStatement}.
853     *
854     *  @see    #execute()
855     */
856    @SuppressWarnings( "BooleanMethodNameMustStartWithQuestion" )
857    public boolean getMoreResults() throws SQLException;
858
859    /**
860     *  <p>{@summary Moves to this {@code EnhancedPreparedStatement} instance's
861     *  next result, deals with any current
862     *  {@link java.sql.ResultSet}
863     *  instance(s) according  to the instructions specified by the given flag,
864     *  and returns {@code true} if the next result is a {@code ResultSet}
865     *  object.}</p>
866     *  <p>There are no more results when the following is true:</p>
867     *  <pre><code>
868     *     // stmt is a Statement object
869     *     ((stmt.getMoreResults(&nbsp;current&nbsp;) == false) &amp;&amp; (stmt.getUpdateCount() == -1))
870     *  </code></pre>
871     *
872     *  @param  current One of the following {@code Statement} constants
873     *      indicating what should happen to current
874     *      {@link java.sql.ResultSet}
875     *      instances obtained using the method
876     *      {@link #getResultSet()}:
877     *      {@link java.sql.Statement#CLOSE_CURRENT_RESULT},
878     *      {@link java.sql.Statement#KEEP_CURRENT_RESULT},
879     *      or
880     *      {@link java.sql.Statement#CLOSE_ALL_RESULTS}.
881     *  @return {@code true} if the next result is a {@code ResultSet}
882     *      instance, {@code false} if it is an update count or there are no
883     *      more results
884     *  @throws SQLException    A database access error occurred, this method
885     *      was called on a closed {@code EnhancedPreparedStatement} or the
886     *      argument supplied is not one of the following:
887     *      {@link java.sql.Statement#CLOSE_CURRENT_RESULT},
888     *      {@link java.sql.Statement#KEEP_CURRENT_RESULT},
889     *      or
890     *      {@link java.sql.Statement#CLOSE_ALL_RESULTS}.
891     *  @throws SQLFeatureNotSupportedException
892     *      {@link java.sql.DatabaseMetaData#supportsMultipleOpenResults()}
893     *      returned {@code false} and either
894     *      {@link java.sql.Statement#KEEP_CURRENT_RESULT}
895     *      or
896     *      {@link java.sql.Statement#CLOSE_ALL_RESULTS}
897     *      are supplied as the argument.
898     *
899     *  @see    #execute()
900     *  @see    #getMoreResults()
901     */
902    @SuppressWarnings( "BooleanMethodNameMustStartWithQuestion" )
903    public boolean getMoreResults( final int current ) throws SQLException;
904
905    /**
906     *  Retrieves the number, types and properties of this
907     *  {@code EnhancedPreparedStatement}
908     *  instance's parameters.
909     *
910     *  @return An instance of {@code ParameterMetaData} that contains
911     *      information about the number, types and properties for each named
912     *      parameter of this {@code EnhancedPreparedStatement} instance.
913     *  @throws SQLException    A database access error occurred or this method
914     *      was called on a closed {@code EnhancedPreparedStatement}.
915     *
916     *  @see java.sql.ParameterMetaData
917     *  @see org.tquadrat.foundation.sql.ParameterMetaData
918     */
919    public ParameterMetaData getParameterMetaData() throws SQLException;
920
921    /**
922     *  <p>{@summary Retrieves the number of seconds the driver will wait for a
923     *  {@link java.sql.Statement}
924     *  instance to execute.} If the limit is exceeded, a
925     *  {@link SQLTimeoutException}
926     *  is thrown.</p>
927     *
928     *  @return The current query timeout limit in seconds; zero means there is
929     *      no limit.
930     *  @throws SQLException    A database access error occurred or this method
931     *      was called on a closed {@code EnhancedPreparedStatement}.
932     *
933     *  @see    #setQueryTimeout(int)
934     */
935    public int getQueryTimeout() throws SQLException;
936
937    /**
938     *  <p>{@summary Retrieves the current result as a
939     *  {@link ResultSet}
940     *  instance.}</p>
941     *
942     *  @note   This method should be called only once per result.
943     *
944     *  @return The current result as a {@code ResultSet} instance or
945     *      {@code null} if the result is an update count or there are no more
946     *      results.
947     *  @throws SQLException    A database access error occurred or this method
948     *      was called on a closed {@code EnhancedPreparedStatement}.
949     *
950     *  @see    #execute()
951     */
952    public ResultSet getResultSet() throws SQLException;
953
954    /**
955     *  Retrieves the result set concurrency for
956     *  {@link java.sql.ResultSet}
957     *  instances generated by this {@code EnhancedPreparedStatement}
958     *  instance.
959     *
960     *  @return Either
961     *      {@link java.sql.ResultSet#CONCUR_READ_ONLY}
962     *      or
963     *      {@link java.sql.ResultSet#CONCUR_UPDATABLE}.
964     *  @throws SQLException    A database access error occurred or this method
965     *      was called on a closed {@code EnhancedPreparedStatement}.
966     */
967    public int getResultSetConcurrency() throws SQLException;
968
969    /**
970     *  Retrieves the result set holdability for
971     *  {@link java.sql.ResultSet}
972     *  instances generated by this {@code EnhancedPreparedStatement} instance.
973     *
974     *  @return Either
975     *      {@link java.sql.ResultSet#HOLD_CURSORS_OVER_COMMIT}
976     *      ({@value java.sql.ResultSet#HOLD_CURSORS_OVER_COMMIT})
977     *      or
978     *      {@link java.sql.ResultSet#CLOSE_CURSORS_AT_COMMIT}
979     *      ({@value java.sql.ResultSet#CLOSE_CURSORS_AT_COMMIT}).
980     *  @throws SQLException    A database access error occurred or this method
981     *      was called on a closed {@code EnhancedPreparedStatement}.
982     */
983    public int getResultSetHoldability() throws SQLException;
984
985    /**
986     *  Retrieves the result set type for
987     *  {@link java.sql.ResultSet}
988     *  instances generated by this {@code EnhancedPreparedStatement}
989     *  instance.
990     *
991     *  @return One of
992     *      {@link java.sql.ResultSet#TYPE_FORWARD_ONLY},
993     *      {@link java.sql.ResultSet#TYPE_SCROLL_INSENSITIVE},
994     *      or
995     *      {@link java.sql.ResultSet#TYPE_SCROLL_SENSITIVE}.
996     *  @throws SQLException    A database access error occurred or this method
997     *      was called on a closed {@code EnhancedPreparedStatement}.
998     */
999    public int getResultSetType()  throws SQLException;
1000
1001    /**
1002     *  <p>{@summary Retrieves the current result as an update count.} If the
1003     *  result is a
1004     *  {@link ResultSet}
1005     *  object or there are no more results, -1 is returned.</p>
1006     *
1007     *  @note   This method should be called only once per result.
1008     *
1009     *  @return The current result as an update count; -1 if the current result
1010     *      is a {@code ResultSet} object or there are no more results.
1011     *  @throws SQLException    A database access error occurred or this method
1012     *      was called on a closed {@code EnhancedPreparedStatement}.
1013     *
1014     *  @see    #execute()
1015     */
1016    public int getUpdateCount() throws SQLException;
1017
1018    /**
1019     *  <p>{@summary Retrieves the first warning reported by calls on this
1020     *  {@code EnhancedPreparedStatement} instance.} Subsequent warnings
1021     *  regarding the execution of this instance will be chained to this
1022     *  {@link java.sql.SQLWarning}
1023     *  instance</p>.
1024     *  <p>The warning chain is automatically cleared each time a statement is
1025     *  (re)executed. This method may not be called on a closed
1026     *  {@code EnhancedPreparedStatement} instance; doing so will cause an
1027     *  {@link SQLException}
1028     *  to be thrown.</p>
1029     *
1030     *  @note   If you are processing a {@code ResultSet} instance, any
1031     *      warnings associated with reads on that {@code ResultSet} instance
1032     *      will be chained on it rather than on the statement instance that
1033     *      produced it.
1034     *
1035     *  @return The first {@code SQLWarning} object or {@code null} if there
1036     *      are no warnings.
1037     *  @throws SQLException    A database access error occurred or this method
1038     *      was called on a closed {@code EnhancedPreparedStatement}.
1039     *
1040     *  @see    #clearWarnings()
1041     */
1042    public SQLWarning getWarnings() throws SQLException;
1043
1044    /**
1045     *  <p>{@summary Retrieves whether this {@code EnhancedPreparedStatement}
1046     *  object has been closed.} An {@code EnhancedPreparedStatement} is closed
1047     *  if the method
1048     *  {@link #close()} has been called on it, or if it is automatically
1049     *  closed.</p>
1050     *
1051     *  @return {@code true} if this {@code EnhancedPreparedStatement} object
1052     *      is closed; {@code false} if it is still open.
1053     *
1054     *  @throws SQLException    A database access error occurred.
1055     */
1056    public boolean isClosed() throws SQLException;
1057
1058    /**
1059     *  <p>{@summary Returns a value indicating whether this
1060     *  {@code EnhancedPreparedStatement} will be closed when all its dependent
1061     *  result sets are closed.}</p>
1062     *
1063     *  @return {@code true} if this {@code EnhancedPreparedStatement} will be
1064     *      closed when all of its dependent result sets are closed,
1065     *      {@code false} otherwise.
1066     *
1067     *  @throws SQLException    This method was called on a closed
1068     *      {@code EnhancedPreparedStatement}.
1069     */
1070    public boolean isCloseOnCompletion() throws SQLException;
1071
1072    /**
1073     *  Checks whether logging is currently enabled.
1074     *
1075     *  @return {@code true} if logging is enabled and log information have to
1076     *      be collected, {@code false} otherwise.
1077     */
1078    public boolean isLoggingEnabled();
1079
1080    /**
1081     *  Returns a  value indicating whether the wrapped
1082     *  {@link java.sql.PreparedStatement}
1083     *  is poolable or not.
1084     *
1085     *  @return {@code true} if the {@code PreparedStatement} is poolable,
1086     *      {@code false} otherwise
1087     *  @throws SQLException    This method was called on a closed
1088     *      {@code EnhancedPreparedStatement}
1089     *
1090     *  @see java.sql.Statement#setPoolable(boolean) setPoolable(boolean)
1091     */
1092    public boolean isPoolable() throws SQLException;
1093
1094    /**
1095     *  Retrieves whether {@code identifier} is a simple SQL identifier.
1096     *
1097     *  @param  identifier  An SQL identifier
1098     *  @return {@code true} if the given value is a simple SQL identifier,
1099     *      {@code false} otherwise
1100     *  @throws SQLException    A database access error occurred.
1101     */
1102    public boolean isSimpleIdentifier( final String identifier) throws SQLException;
1103
1104    /**
1105     *  <p>{@summary Creates a new {@code EnhancedPreparedStatement}
1106     *  instance.}</p>
1107     *  <p>The text for the SQL statement is different from the format that
1108     *  is used by
1109     *  {@link java.sql.Connection#prepareStatement(String)}
1110     *  to create an instance of
1111     *  {@link java.sql.PreparedStatement}:
1112     *  this format uses explicit names instead of simple question marks as
1113     *  placeholders. This means, instead of</p>
1114     *  <pre><code>SELECT value FROM table WHERE key = ?</code></pre>
1115     *  <p>one will write</p>
1116     *  <pre><code>SELECT value FROM table WHERE key = :key</code></pre>
1117     *  <p>This allows to address the variables by name, and it makes it
1118     *  possible that the same value is only provided once, despite it occurs
1119     *  multiple time.</p>
1120     *  <p>A parameter name is prefixed by a colon, followed by an ASCII
1121     *  letter, then by an arbitrary number of ASCII letters and digits. No
1122     *  special characters are allowed.</p>
1123     *
1124     *  @param  connection  The connection to the database.
1125     *  @param  sql The text of the SQL statement with the placeholders.
1126     *  @return The new statement.
1127     *  @throws SQLException    A database access error occurred, or the given
1128     *      statement could not be parsed properly.
1129     */
1130    @API( status = STABLE, since = "0.1.0" )
1131    public static EnhancedPreparedStatement prepareStatement( final Connection connection, final String sql ) throws SQLException
1132    {
1133        final EnhancedPreparedStatement retValue = EnhancedPreparedStatementImpl.create( connection, sql );
1134
1135        //---* Done *----------------------------------------------------------
1136        return retValue;
1137    }   //  prepareStatement()
1138
1139    /**
1140     *  <p>{@summary Sets the designated parameter to the given
1141     *  {@link java.sql.Array}
1142     *  instance.}</p>
1143     *  <p>The driver converts this to an SQL {@code ARRAY} value when it
1144     *  sends it to the database.</p>
1145     *
1146     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1147     *  @param  value   The parameter value.
1148     *  @throws SQLException    The parameter name did not correspond to any
1149     *      defined parameter in the SQL statement, a database access error
1150     *      occurred or this method was called on a closed
1151     *      {@code EnhancedPreparedStatement}.
1152     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
1153     *      support this method
1154     */
1155    public void setArray ( final String parameterName, final Array value ) throws SQLException;
1156
1157    /**
1158     *  <p>{@summary Sets the designated parameter to the given
1159     *  {@link java.io.InputStream}
1160     *  which will have the specified number of bytes.}</p>
1161     *  <p>When a very large ASCII value is input to a {@code LONGVARCHAR}
1162     *  parameter, it may be more practical to send it via a
1163     *  {@code java.io.InputStream}. The data will be read from the stream as
1164     *  needed until end-of-file is reached. The JDBC driver will do any
1165     *  necessary conversion from ASCII to the database char format.</p>
1166     *
1167     *  @note   This stream object can either be a standard Java stream object
1168     *      or your own subclass that implements the standard interface.
1169     *
1170     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1171     *  @param  value   The parameter value.
1172     *  @param  length  The number of bytes in the stream.
1173     *  @throws SQLException    The parameter name did not correspond to any
1174     *      defined parameter in the SQL statement, a database access error
1175     *      occurred or this method was called on a closed
1176     *      {@code EnhancedPreparedStatement}.
1177     */
1178    public void setAsciiStream( final String parameterName, final InputStream value, final int length ) throws SQLException;
1179
1180    /**
1181     *  <p>{@summary Sets the designated parameter to the given
1182     *  {@link java.io.InputStream}
1183     *  which will have the specified number of bytes.}</p>
1184     *  <p>When a very large ASCII value is input to a {@code LONGVARCHAR}
1185     *  parameter, it may be more practical to send it via a
1186     *  {@code java.io.InputStream}. The data will be read from the stream as
1187     *  needed until end-of-file is reached. The JDBC driver will do any
1188     *  necessary conversion from ASCII to the database char format.</p>
1189     *
1190     *  @note   This stream object can either be a standard Java stream object
1191     *      or your own subclass that implements the standard interface.
1192     *
1193     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1194     *  @param  value   The parameter value.
1195     *  @param  length  The number of bytes in the stream.
1196     *  @throws SQLException    The parameter name did not correspond to any
1197     *      defined parameter in the SQL statement, a database access error
1198     *      occurred or this method was called on a closed
1199     *      {@code EnhancedPreparedStatement}.
1200     */
1201    public void setAsciiStream( final String parameterName, final InputStream value, final long length ) throws SQLException;
1202
1203    /**
1204     *  <p>{@summary Sets the designated parameter to the given
1205     *  {@link java.io.InputStream}.}</p>
1206     *  <p>When a very large ASCII value is input to a {@code LONGVARCHAR}
1207     *  parameter, it may be more practical to send it via a
1208     *  {@code java.io.InputStream}. The data will be read from the stream as
1209     *  needed until end-of-file is reached. The JDBC driver will do any
1210     *  necessary conversion from ASCII to the database char format.</p>
1211     *
1212     *  @note   This stream object can either be a standard Java stream object
1213     *      or your own subclass that implements the standard interface.
1214     *  @note   Consult your JDBC driver documentation to determine if it might
1215     *      be more efficient to use a version of {@code setAsciiStream()}
1216     *      which takes a length parameter.
1217     *
1218     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1219     *  @param  value   The parameter value.
1220     *  @throws SQLException    The parameter name did not correspond to any
1221     *      defined parameter in the SQL statement, a database access error
1222     *      occurred or this method was called on a closed
1223     *      {@code EnhancedPreparedStatement}.
1224     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
1225     *      support this method.
1226     */
1227    public void setAsciiStream( final String parameterName, final InputStream value ) throws SQLException;
1228
1229    /**
1230     *  <p>{@summary Sets the designated parameter to the given
1231     *  {@link java.io.InputStream}
1232     *  which will have the specified number of bytes.}</p>
1233     *  <p>When a very large binary value is input to a {@code LONGVARBINARY}
1234     *  parameter, it may be more practical to send it via a
1235     *  {@code java.io.InputStream}. The data will be read from the stream as
1236     *  needed until end-of-file is reached.</p>
1237     *
1238     *  @note   This stream object can either be a standard Java stream object
1239     *      or your own subclass that implements the standard interface.
1240     *
1241     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1242     *  @param  value   The parameter value.
1243     *  @param  length  The number of bytes in the stream.
1244     *  @throws SQLException    The parameter name did not correspond to any
1245     *      defined parameter in the SQL statement, a database access error
1246     *      occurred or this method was called on a closed
1247     *      {@code EnhancedPreparedStatement}.
1248     */
1249    public void setBinaryStream( final String parameterName, final InputStream value, final int length) throws SQLException;
1250
1251    /**
1252     *  <p>{@summary Sets the designated parameter to the given
1253     *  {@link java.io.InputStream}
1254     *  which will have the specified number of bytes.}</p>
1255     *  <p>When a very large binary value is input to a {@code LONGVARBINARY}
1256     *  parameter, it may be more practical to send it via a
1257     *  {@code java.io.InputStream}. The data will be read from the stream as
1258     *  needed until end-of-file is reached.</p>
1259     *
1260     *  @note   This stream object can either be a standard Java stream object
1261     *      or your own subclass that implements the standard interface.
1262     *
1263     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1264     *  @param  value   The parameter value.
1265     *  @param  length  The number of bytes in the stream.
1266     *  @throws SQLException    The parameter name did not correspond to any
1267     *      defined parameter in the SQL statement, a database access error
1268     *      occurred or this method was called on a closed
1269     *      {@code EnhancedPreparedStatement}.
1270     */
1271    public void setBinaryStream( final String parameterName, final InputStream value, final long length ) throws SQLException;
1272
1273    /**
1274     *  <p>{@summary Sets the designated parameter to the given
1275     *  {@link java.io.InputStream}.}</p>
1276     *  <p>When a very large binary value is input to a {@code LONGVARBINARY}
1277     *  parameter, it may be more practical to send it via a
1278     *  {@code java.io.InputStream}. The data will be read from the stream as
1279     *  needed until end-of-file is reached.</p>
1280     *
1281     *  @note   This stream object can either be a standard Java stream object
1282     *      or your own subclass that implements the standard interface.
1283     *  @note   Consult your JDBC driver documentation to determine if it might
1284     *      be more efficient to use a version of {@code setBinaryStream()}
1285     *      which takes a length parameter.
1286     *
1287     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1288     *  @param  value   The parameter value.
1289     *  @throws SQLException    The parameter name did not correspond to any
1290     *      defined parameter in the SQL statement, a database access error
1291     *      occurred or this method was called on a closed
1292     *      {@code EnhancedPreparedStatement}.
1293     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
1294     *      support this method.
1295     */
1296    public void setBinaryStream( final String parameterName, final InputStream value ) throws SQLException;
1297
1298    /**
1299     *  <p>{@summary Sets the designated parameter to the given Java
1300     *  {@link BigDecimal}
1301     *  value.}</p>
1302     *  <p>The driver converts this to an SQL {@code NUMERIC} value when it
1303     *  sends it to the database.</p>
1304     *
1305     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1306     *  @param  value   The parameter value.
1307     *  @throws SQLException    The parameter name did not correspond to any
1308     *      defined parameter in the SQL statement, a database access error
1309     *      occurred or this method was called on a closed
1310     *      {@code EnhancedPreparedStatement}.
1311     */
1312    void setBigDecimal( final String parameterName, final BigDecimal value ) throws SQLException;
1313
1314    /**
1315     *  <p>{@summary Sets the designated parameter to the given Java
1316     *  {@link java.sql.Blob}
1317     *  instance.}</p>
1318     *  <p>The driver converts this to an SQL {@code BLOB} value when it
1319     *  sends it to the database.</p>
1320     *
1321     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1322     *  @param  value   The parameter value.
1323     *  @throws SQLException    The parameter name did not correspond to any
1324     *      defined parameter in the SQL statement, a database access error
1325     *      occurred or this method was called on a closed
1326     *      {@code EnhancedPreparedStatement}.
1327     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
1328     *      support this method.
1329     */
1330    public void setBlob ( final String parameterName, final Blob value ) throws SQLException;
1331
1332    /**
1333     *  <p>{@summary Sets the designated parameter to a
1334     *  {@link java.io.InputStream}
1335     *  object.} The {@code InputStream} must contain  the number of characters
1336     *  as specified by the {@code length} argument, otherwise a
1337     *  {@link SQLException}
1338     *  will be generated when the {@code EnhancedPreparedStatement} is
1339     *  executed.</p>
1340     *  <p>This method differs from the
1341     *  {@link #setBinaryStream (String,InputStream,int)}
1342     *  method because it informs the driver that the parameter value should be
1343     *  sent to the server as a {@code BLOB}. When the
1344     *  {@code setBinaryStream()} method is used, the driver may have to do
1345     *  extra work to determine whether the parameter data should be sent to
1346     *  the server as a {@code LONGVARBINARY} or a {@code BLOB}.</p>
1347     *
1348     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1349     *  @param  value   The {@code InputStream} instance that contains the data
1350     *      to set the parameter value to.
1351     *  @param  length  The number of bytes in the parameter data.
1352     *  @throws SQLException    The parameter name did not correspond to any
1353     *      defined parameter in the SQL statement, a database access error
1354     *      occurred, this method was called on a closed
1355     *      {@code EnhancedPreparedStatement}, the specified length was less
1356     *      than zero or if the number of bytes in the {@code InputStream} did
1357     *      not match the specified length.
1358     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
1359     *      support this method.
1360     */
1361    public void setBlob(  final String parameterName, final InputStream value, final long length ) throws SQLException;
1362
1363    /**
1364     *  <p>{@summary Sets the designated parameter to a
1365     *  {@link java.io.InputStream}
1366     *  object.}</p>
1367     *  <p>This method differs from the
1368     *  {@link #setBinaryStream (String,InputStream,int)}
1369     *  method because it informs the driver that the parameter value should be
1370     *  sent to the server as a {@code BLOB}. When the
1371     *  {@code setBinaryStream()} method is used, the driver may have to do
1372     *  extra work to determine whether the parameter data should be sent to
1373     *  the server as a {@code LONGVARBINARY} or a {@code BLOB}.</p>
1374     *
1375     *  @note   Consult your JDBC driver documentation to determine if it might
1376     *      be more efficient to use a version of {@code setBlob()} which takes
1377     *      a length parameter.
1378     *
1379     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1380     *  @param  value   The {@code InputStream} instance that contains the data
1381     *      to set the parameter value to.
1382     *  @throws SQLException    The parameter name did not correspond to any
1383     *      defined parameter in the SQL statement, a database access error
1384     *      occurred, or this method was called on a closed
1385     *      {@code EnhancedPreparedStatement}.
1386     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
1387     *      support this method.
1388     */
1389    public void setBlob( final String parameterName, final InputStream value ) throws SQLException;
1390
1391    /**
1392     *  <p>{@summary Sets the designated parameter to the given Java
1393     *  {@code boolean} value.}</p>
1394     *  <p>The driver converts this to an SQL {@code BIT} or {@code BOOLEAN}
1395     *  value when it sends it to the database.</p>
1396     *  <p>For the logging, it is always {@code BOOLEAN}.</p>
1397     *
1398     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1399     *  @param  value   The parameter value.
1400     *  @throws SQLException    The parameter name did not correspond to any
1401     *      defined parameter in the SQL statement, a database access error
1402     *      occurred or this method was called on a closed
1403     *      {@code EnhancedPreparedStatement}.
1404     */
1405    public void setBoolean( final String parameterName, final boolean value ) throws SQLException;
1406
1407    /**
1408     *  <p>{@summary Sets the designated parameter to the given Java
1409     *  {@code byte} value.}</p>
1410     *  <p>The driver converts this to an SQL {@code TINYINT} value when it
1411     *  sends it to the database.</p>
1412     *
1413     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1414     *  @param  value   The parameter value.
1415     *  @throws SQLException    The parameter name did not correspond to any
1416     *      defined parameter in the SQL statement, a database access error
1417     *      occurred or this method was called on a closed
1418     *      {@code EnhancedPreparedStatement}.
1419     */
1420    public void setByte( final String parameterName, final byte value ) throws SQLException;
1421
1422    /**
1423     *  <p>{@summary Sets the designated parameter to the given Java
1424     *  array of bytes.}</p>
1425     *  <p>The driver converts this to an SQL {@code VARBINARY} or
1426     *  {@code LONGVARBINARY} (depending on the argument's size relative to the
1427     *  driver's limits on {@code VARBINARY} values) when it sends it to the
1428     *  database.</p>
1429     *  <p>For the logging, it is always {@code VARBINARY}.</p>
1430     *
1431     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1432     *  @param  value   The parameter value.
1433     *  @throws SQLException    The parameter name did not correspond to any
1434     *      defined parameter in the SQL statement, a database access error
1435     *      occurred or this method was called on a closed
1436     *      {@code EnhancedPreparedStatement}.
1437     */
1438    public void setBytes( final String parameterName, final byte [] value ) throws SQLException;
1439
1440    /**
1441     *  <p>{@summary Sets the designated parameter to the given
1442     *  {@link Reader}
1443     *  instance, which provides the given number of characters.}</p>
1444     *  <p>When a very large UNICODE value is input to a {@code LONGVARCHAR}
1445     *  parameter, it may be more practical to send it via a
1446     *  {@code java.io.Reader} instance. The data will be read from the stream
1447     *  as needed until end-of-file is reached. The JDBC driver will do any
1448     *  necessary conversion from UNICODE to the database char format.</p>
1449     *
1450     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1451     *  @param  value   The {@code java.io.Reader} object that contains the
1452     *      Unicode data.
1453     *  @param  length The number of characters in the stream.
1454     *  @throws SQLException    The parameter name did not correspond to any
1455     *      defined parameter in the SQL statement, a database access error
1456     *      occurred or this method was called on a closed
1457     *      {@code EnhancedPreparedStatement}.
1458     */
1459    public void setCharacterStream( final String parameterName, final Reader value, final int length ) throws SQLException;
1460
1461    /**
1462     *  <p>{@summary Sets the designated parameter to the given
1463     *  {@link Reader}
1464     *  instance, which provides the given number of characters.}</p>
1465     *  <p>When a very large UNICODE value is input to a {@code LONGVARCHAR}
1466     *  parameter, it may be more practical to send it via a
1467     *  {@code java.io.Reader} instance. The data will be read from the stream
1468     *  as needed until end-of-file is reached. The JDBC driver will do any
1469     *  necessary conversion from UNICODE to the database char format.</p>
1470     *
1471     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1472     *  @param  value   The {@code java.io.Reader} object that contains the
1473     *      Unicode data.
1474     *  @param  length The number of characters in the stream.
1475     *  @throws SQLException    The parameter name did not correspond to any
1476     *      defined parameter in the SQL statement, a database access error
1477     *      occurred or this method was called on a closed
1478     *      {@code EnhancedPreparedStatement}.
1479     */
1480    public void setCharacterStream( final String parameterName, final Reader value, final long length ) throws SQLException;
1481
1482    /**
1483     *  <p>{@summary Sets the designated parameter to the given
1484     *  {@link Reader}
1485     *  instance.}</p>
1486     *  <p>When a very large UNICODE value is input to a {@code LONGVARCHAR}
1487     *  parameter, it may be more practical to send it via a
1488     *  {@code java.io.Reader} instance. The data will be read from the stream
1489     *  as needed until end-of-file is reached. The JDBC driver will do any
1490     *  necessary conversion from UNICODE to the database char format.</p>
1491     *
1492     *  @note   This reader object can either be a standard Java {@code Reader}
1493     *      object or your own subclass that implements the standard interface.
1494     *  @note   Consult your JDBC driver documentation to determine if it might
1495     *      be more efficient to use a version of {@code setCharacterStream()}
1496     *      which takes a length parameter.
1497     *
1498     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1499     *  @param  value   The {@code java.io.Reader} object that contains the
1500     *      Unicode data.
1501     *  @throws SQLException    The parameter name did not correspond to any
1502     *      defined parameter in the SQL statement, a database access error
1503     *      occurred or this method was called on a closed
1504     *      {@code EnhancedPreparedStatement}.
1505     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
1506     *      support this method.
1507     */
1508    public void setCharacterStream( final String parameterName, final Reader value ) throws SQLException;
1509
1510    /**
1511     *  <p>{@summary Sets the designated parameter to the given
1512     *  {@link java.sql.Clob}
1513     *  instance.}</p>
1514     *  <p>The driver converts this to an SQL {@code CLOB} value when it
1515     *  sends it to the database.</p>
1516     *
1517     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1518     *  @param  value   The parameter value.
1519     *  @throws SQLException    The parameter name did not correspond to any
1520     *      defined parameter in the SQL statement, a database access error
1521     *      occurred or this method was called on a closed
1522     *      {@code EnhancedPreparedStatement}.
1523     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
1524     *      support this method
1525     */
1526    public void setClob( final String parameterName, final Clob value ) throws SQLException;
1527
1528    /**
1529     *  <p>{@summary Sets the designated parameter to a
1530     *  {@link java.io.Reader}
1531     *  instance.} The reader must contain the number of characters specified
1532     *  by the {@code length} argument, otherwise a
1533     *  {@link SQLException}
1534     *  will be generated when the {@code EnhancedPreparedStatement} is
1535     *  executed.</p>
1536     *  <p>This method differs from the
1537     *  {@link #setCharacterStream(String,Reader,int)}
1538     *  method because it informs the driver that the parameter value should be
1539     *  sent to the server as a {@code CLOB}. When the
1540     *  {@code setCharacterStream()} method is used, the driver may have to do
1541     *  extra work to determine whether the parameter data should be sent to
1542     *  the server as a {@code LONGVARCHAR} or a {@code CLOB}.</p>
1543     *
1544     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1545     *  @param  value   The {@code java.io.Reader} object that contains the
1546     *      data to set the parameter value to.
1547     *  @param  length The number of characters in the stream.
1548     *  @throws SQLException    The parameter name did not correspond to any
1549     *      defined parameter in the SQL statement, a database access error
1550     *      occurred or this method was called on a closed
1551     *      {@code EnhancedPreparedStatement}, the {@code Reader} was shorter
1552     *      than specified, or the specified length was less than zero.
1553     *  @throws SQLFeatureNotSupportedException  The JDBC driver does not
1554     *      support this method.
1555     */
1556    public void setClob( final String parameterName, final Reader value, final long length ) throws SQLException;
1557
1558    /**
1559     *  <p>{@summary Sets the designated parameter to a
1560     *  {@link java.io.Reader}
1561     *  instance.}</p>
1562     *  <p>This method differs from the
1563     *  {@link #setCharacterStream(String,Reader,int)}
1564     *  method because it informs the driver that the parameter value should be
1565     *  sent to the server as a {@code CLOB}. When the
1566     *  {@code setCharacterStream()} method is used, the driver may have to do
1567     *  extra work to determine whether the parameter data should be sent to
1568     *  the server as a {@code LONGVARCHAR} or a {@code CLOB}.</p>
1569     *
1570     *  @note   Consult your JDBC driver documentation to determine if it might
1571     *      be more efficient to use a version of {@code setClob()} which takes
1572     *      a length parameter.
1573     *
1574     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1575     *  @param  value   The {@code java.io.Reader} object that contains the
1576     *      data to set the parameter value to.
1577     *  @throws SQLException    The parameter name did not correspond to any
1578     *      defined parameter in the SQL statement, a database access error
1579     *      occurred or this method was called on a closed
1580     *      {@code EnhancedPreparedStatement}.
1581     *  @throws SQLFeatureNotSupportedException  The JDBC driver does not
1582     *      support this method.
1583     */
1584    public void setClob( final String parameterName, final Reader value ) throws SQLException;
1585
1586    /**
1587     *  <p>{@summary Sets the SQL cursor name to the given String, which will
1588     *  be used by subsequent statement {@code execute()} methods.} This name
1589     *  can then be used in SQL positioned update or delete statements to
1590     *  identify the current row in the
1591     *  {@link java.sql.ResultSet}
1592     *  instance generated by this statement.  If the database does not support
1593     *  positioned update/delete, this method is a noop.  To ensure that a
1594     *  cursor has the proper isolation level to support updates, the cursor's
1595     *  {@code SELECT} statement should have the form
1596     *  {@code SELECT FOR UPDATE}. If {@code FOR UPDATE} is not present,
1597     *  positioned updates may fail.</p>
1598     *
1599     *  @note   By definition, the execution of positioned updates and deletes
1600     *  must be done by a different statement instances than the one that
1601     *  generated the {@code ResultSet} object being used for positioning.
1602     *  Also, cursor names must be unique within a connection.
1603     *
1604     *  @param  name    The new cursor name, which must be unique within a
1605     *      connection.
1606     *  @throws SQLException    A database access error occurred or this method
1607     *      was called on a closed {@code EnhancedPreparedStatement}.
1608     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
1609     *      support this method.
1610     */
1611    public void setCursorName( final String name ) throws SQLException;
1612
1613    /**
1614     *  <p>{@summary Sets the designated parameter to the given
1615     *  {@link java.sql.Date}
1616     *  value using the default time zone of the virtual machine that is
1617     *  running the application.}</p>
1618     *  <p>The driver converts this to an SQL {@code DATE} value when it
1619     *  sends it to the database.</p>
1620     *
1621     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1622     *  @param  value   The parameter value.
1623     *  @throws SQLException    The parameter name did not correspond to any
1624     *      defined parameter in the SQL statement, a database access error
1625     *      occurred or this method was called on a closed
1626     *      {@code EnhancedPreparedStatement}.
1627     */
1628    public void setDate( final String parameterName, final Date value ) throws SQLException;
1629
1630    /**
1631     *  <p>{@summary Sets the designated parameter to the given
1632     *  {@link java.sql.Date}
1633     *  value using the given
1634     *  {@link java.util.Calendar}
1635     *  instance.} The driver used the {@code Calendar} instance to construct
1636     *  an SQL {@code DATE} value, which the driver then sends to the database.
1637     *  With the {@code Calendar} instance, the driver can calculate the date
1638     *  taking into account a custom timezone. If no {@code Calendar} instance
1639     *  is specified, the driver uses the default timezone, which is that of
1640     *  the virtual machine running the application.</p>
1641     *
1642     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1643     *  @param  value   The parameter value.
1644     *  @param  calendar    The {@code Calendar} instance the driver will use
1645     *      to construct the date.
1646     *  @throws SQLException    The parameter name did not correspond to any
1647     *      defined parameter in the SQL statement, a database access error
1648     *      occurred or this method was called on a closed
1649     *      {@code EnhancedPreparedStatement}.
1650     */
1651    @SuppressWarnings( "UseOfObsoleteDateTimeApi" )
1652    public void setDate( final String parameterName, final Date value, final Calendar calendar ) throws SQLException;
1653
1654    /**
1655     *  <p>{@summary Sets the designated parameter to the given Java
1656     *  {@code double} value.}</p>
1657     *  <p>The driver converts this to an SQL {@code DOUBLE} value when it
1658     *  sends it to the database.</p>
1659     *
1660     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1661     *  @param  value   The parameter value.
1662     *  @throws SQLException    The parameter name did not correspond to any
1663     *      defined parameter in the SQL statement, a database access error
1664     *      occurred or this method was called on a closed
1665     *      {@code EnhancedPreparedStatement}.
1666     */
1667    public void setDouble( final String parameterName, final double value ) throws SQLException;
1668
1669    /**
1670     *  <p>{@summary Gives the driver a hint as to the direction in which rows
1671     *  will be processed in
1672     *  {@link java.sql.ResultSet}
1673     *  instances created using this {@code EnhancedPreparedStatement} object.}
1674     *  The default value is
1675     *  {@link java.sql.ResultSet#FETCH_FORWARD}.</p>
1676     *  <p>Note that this method sets only the default fetch direction for
1677     *  result sets generated by this {@code EnhancedPreparedStatement}
1678     *  instance. Each result set has its own methods for getting and setting
1679     *  its own fetch direction.</p>
1680     *
1681     *  @param  direction   The initial direction for processing rows.
1682     *  @throws SQLException    A database access error occurred, this method
1683     *      was called on a closed {@code EnhancedPreparedStatement} or the
1684     *      given direction is not one of
1685     *      {@link java.sql.ResultSet#FETCH_FORWARD},
1686     *      {@link java.sql.ResultSet#FETCH_REVERSE},
1687     *      or
1688     *      {@link java.sql.ResultSet#FETCH_UNKNOWN}
1689     *
1690     *  @see    #getFetchDirection()
1691     *  @see    java.sql.ResultSet#setFetchDirection(int)
1692     *  @see    java.sql.ResultSet#getFetchDirection()
1693     */
1694    public void setFetchDirection( final int direction ) throws SQLException;
1695
1696    /**
1697     *  <p>{@summary Gives the JDBC driver a hint as to the number of rows that
1698     *  should be fetched from the database when more rows are needed for
1699     *  {@link java.sql.ResultSet}
1700     *  instances generated by this {@code EnhancedPreparedStatement}
1701     *  instance.}
1702     *  If the specified value is zero, then the hint is ignored.</p>
1703     *  <p>The default value is zero.</p>
1704     *
1705     *  @param  rows    The number of rows to fetch.
1706     *  @throws SQLException    A database access error occurred, this method
1707     *      was called on a closed {@code EnhancedPreparedStatement} or the
1708     *      condition {@code rows >= 0} was not satisfied.
1709     */
1710    public void setFetchSize( final int rows ) throws SQLException;
1711
1712    /**
1713     *  <p>{@summary Sets the designated parameter to the given Java
1714     *  {@code float} value.}</p>
1715     *  <p>The driver converts this to an SQL {@code REAL} value when it
1716     *  sends it to the database.</p>
1717     *
1718     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1719     *  @param  value   The parameter value.
1720     *  @throws SQLException    The parameter name did not correspond to any
1721     *      defined parameter in the SQL statement, a database access error
1722     *      occurred or this method was called on a closed
1723     *      {@code EnhancedPreparedStatement}.
1724     */
1725    public void setFloat( final String parameterName, final float value ) throws SQLException;
1726
1727    /**
1728     *  <p>{@summary Sets the designated parameter to the given Java
1729     *  {@code int} value.}</p>
1730     *  <p>The driver converts this to an SQL {@code INTEGER} value when it
1731     *  sends it to the database.</p>
1732     *
1733     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1734     *  @param  value   The parameter value.
1735     *  @throws SQLException    The parameter name did not correspond to any
1736     *      defined parameter in the SQL statement, a database access error
1737     *      occurred or this method was called on a closed
1738     *      {@code EnhancedPreparedStatement}.
1739     */
1740    public void setInt( final String parameterName, final int value ) throws SQLException;
1741
1742    /**
1743     *  <p>{@summary Sets the limit for the maximum number of rows that any
1744     *  {@link ResultSet}
1745     *  instance generated by this {@code EnhancedPreparedStatement} instance
1746     *  can contain.} If the limit is exceeded, the excess rows are silently
1747     *  dropped.</p>
1748     *  <p>This method should be used when the row limit may exceed
1749     *  {@link Integer#MAX_VALUE}.</p>
1750     *  <p>The default implementation will throw
1751     *  {@link UnsupportedOperationException}.</p>
1752     *
1753     *  @param  max The new max rows limit; zero means there is no limit.
1754     *  @throws SQLException    A database access error occurred, this method
1755     *      was called on a closed {@code EnhancedPreparedStatement} or the
1756     *      condition {@code max >= 0} is not satisfied.
1757     *
1758     *  @see    #setMaxRows(int)
1759     *  @see    #getMaxRows()
1760     *  @see    #getLargeMaxRows()
1761     */
1762    public void setLargeMaxRows( final long max) throws SQLException;
1763
1764    /**
1765     *  <p>{@summary Sets the designated parameter to the given Java
1766     *  {@code long} value.}</p>
1767     *  <p>The driver converts this to an SQL {@code BIGINT} value when it
1768     *  sends it to the database.</p>
1769     *
1770     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1771     *  @param  value   The parameter value.
1772     *  @throws SQLException    The parameter name did not correspond to any
1773     *      defined parameter in the SQL statement, a database access error
1774     *      occurred or this method was called on a closed
1775     *      {@code EnhancedPreparedStatement}.
1776     */
1777    public void setLong( final String parameterName, final long value ) throws SQLException;
1778
1779    /**
1780     *  <p>{@summary Sets the limit for the maximum number of bytes that can be
1781     *  returned for character and binary column values in a {@code ResultSet}
1782     *  object produced by this {@code Statement} object.}</p>
1783     *  <p>This limit applies only to
1784     *  {@link java.sql.JDBCType#BINARY},
1785     *  {@link java.sql.JDBCType#VARBINARY},
1786     *  {@link java.sql.JDBCType#LONGVARBINARY},
1787     *  {@link java.sql.JDBCType#CHAR},
1788     *  {@link java.sql.JDBCType#VARCHAR},
1789     *  {@link java.sql.JDBCType#NCHAR},
1790     *  {@link java.sql.JDBCType#NVARCHAR},
1791     *  {@link java.sql.JDBCType#LONGNVARCHAR}
1792     *  and
1793     *  {@link java.sql.JDBCType#LONGVARCHAR}
1794     *  columns. If the limit is exceeded, the excess data is silently
1795     *  discarded. For maximum portability, use values greater than 256.</p>
1796     *
1797     *  @param  max The new column size limit in bytes; zero means there is no
1798     *      limit.
1799     *  @throws SQLException    A database access error occurred, this method
1800     *      was called on a closed {@code EnhancedPreparedStatement} or the
1801     *      condition {@code max >= 0} is not satisfied.
1802     *
1803     *  @see    #getMaxFieldSize()
1804     */
1805    public void setMaxFieldSize( final int max ) throws SQLException;
1806
1807    /**
1808     *  <p>{@summary Sets the limit for the maximum number of rows, that any
1809     *  {@link ResultSet}
1810     *  instance generated by this {@code EnhancedPreparedStatement} instance
1811     *  can contain, to the given number.} If the limit is exceeded, the excess
1812     *  rows are silently dropped.</p>
1813     *
1814     *  @param  max The new max rows limit; zero means there is no limit.
1815     *  @throws SQLException    A database access error occurred, this method
1816     *      was called on a closed {@code EnhancedPreparedStatement} or the
1817     *      condition {@code max >= 0} was not satisfied.
1818     *
1819     *  @see    #getMaxRows()
1820     *  @see    #getLargeMaxRows()
1821     *  @see    #setLargeMaxRows(long)
1822     */
1823    public void setMaxRows( final int max ) throws SQLException;
1824
1825    /**
1826     *  <p>{@summary Sets the designated parameter to the given
1827     *  {@link Reader}
1828     *  instance.}</p>
1829     *  <p>The {@code Reader} reads the data till end-of-file is reached. The
1830     *  driver does the necessary conversion from Java character format to the
1831     *  national character set in the database.</p>
1832     *
1833     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1834     *  @param  value   The {@code java.io.Reader} object that contains the
1835     *      data.
1836     *  @param  length The number of characters in the stream.
1837     *  @throws SQLException    The parameter name did not correspond to any
1838     *      defined parameter in the SQL statement, the driver does not support
1839     *      national character sets, the driver detected that a data conversion
1840     *      error could occur, a database access error occurred or this method
1841     *      was called on a closed
1842     *      {@code EnhancedPreparedStatement}.
1843     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
1844     *      support this method,
1845     */
1846    void setNCharacterStream(  final String parameterName, final Reader value, long length) throws SQLException;
1847
1848    /**
1849     *  <p>{@summary Sets the designated parameter to the given
1850     *  {@link Reader}
1851     *  instance.}</p>
1852     *  <p>The {@code Reader} reads the data till end-of-file is reached. The
1853     *  driver does the necessary conversion from Java character format to the
1854     *  national character set in the database.</p>
1855     *
1856     *  @note   This reader object can either be a standard Java {@code Reader}
1857     *      object or your own subclass that implements the standard interface.
1858     *  @note   Consult your JDBC driver documentation to determine if it might
1859     *      be more efficient to use a version of {@code setNCharacterStream()}
1860     *      which takes a length parameter.
1861     *
1862     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1863     *  @param  value   The {@code java.io.Reader} object that contains the
1864     *      data.
1865     *  @throws SQLException    The parameter name did not correspond to any
1866     *      defined parameter in the SQL statement, the driver does not support
1867     *      national character sets, the driver detected that a data conversion
1868     *      error could occur, a database access error occurred or this method
1869     *      was called on a closed
1870     *      {@code EnhancedPreparedStatement}.
1871     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
1872     *      support this method,
1873     */
1874    public void setNCharacterStream( final String parameterName, final Reader value) throws SQLException;
1875
1876    /**
1877     *  <p>{@summary Sets the designated parameter to the given
1878     *  {@link java.sql.NClob} value.}</p>
1879     *  <p>The driver converts this to an SQL {@code NCLOB} value when it
1880     *  sends it to the database.</p>
1881     *
1882     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1883     *  @param  value   The parameter value.
1884     *  @throws SQLException    The parameter name did not correspond to any
1885     *      defined parameter in the SQL statement, the driver does not support
1886     *      national character sets, the driver detected that a data conversion
1887     *      error could occur, a database access error occurred or this method
1888     *      was called on a closed
1889     *      {@code EnhancedPreparedStatement}.
1890     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
1891     *      support this method,
1892     */
1893    public void setNClob( final String parameterName, final NClob value ) throws SQLException;
1894
1895    /**
1896     *  <p>{@summary Sets the designated parameter to a
1897     *  {@link java.io.Reader}
1898     *  instance.} The reader must contain the number of characters specified
1899     *  by the {@code length} argument, otherwise a
1900     *  {@link SQLException}
1901     *  will be generated when the {@code EnhancedPreparedStatement} is
1902     *  executed.</p>
1903     *  <p>This method differs from the
1904     *  {@link #setNCharacterStream(String,Reader,long)}
1905     *  method because it informs the driver that the parameter value should be
1906     *  sent to the server as a {@code NCLOB}. When the
1907     *  {@code setNCharacterStream()} method is used, the driver may have to do
1908     *  extra work to determine whether the parameter data should be sent to
1909     *  the server as a {@code LONGNVARCHAR} or a {@code NCLOB}.</p>
1910     *
1911     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1912     *  @param  value   The {@code java.io.Reader} object that contains the
1913     *      data to set the parameter value to.
1914     *  @param  length The number of characters in the stream.
1915     *  @throws SQLException    The parameter name did not correspond to any
1916     *      defined parameter in the SQL statement, a database access error
1917     *      occurred or this method was called on a closed
1918     *      {@code EnhancedPreparedStatement}, the {@code Reader} was shorter
1919     *      than specified, or the specified length was less than zero.
1920     *  @throws SQLFeatureNotSupportedException  The JDBC driver does not
1921     *      support this method.
1922     */
1923    public void setNClob( final String parameterName, final Reader value, final long length ) throws SQLException;
1924
1925    /**
1926     *  <p>{@summary Sets the designated parameter to a
1927     *  {@link java.io.Reader}
1928     *  instance.}</p>
1929     *  <p>This method differs from the
1930     *  {@link #setNCharacterStream(String,Reader,long)}
1931     *  method because it informs the driver that the parameter value should be
1932     *  sent to the server as a {@code NCLOB}. When the
1933     *  {@code setNCharacterStream()} method is used, the driver may have to do
1934     *  extra work to determine whether the parameter data should be sent to
1935     *  the server as a {@code LONGNVARCHAR} or a {@code NCLOB}.</p>
1936     *
1937     *  @note   Consult your JDBC driver documentation to determine if it might
1938     *      be more efficient to use a version of {@code setNClob()} which
1939     *      takes a length parameter.
1940     *
1941     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1942     *  @param  value   The {@code java.io.Reader} object that contains the
1943     *      data to set the parameter value to.
1944     *  @throws SQLException    The parameter name did not correspond to any
1945     *      defined parameter in the SQL statement, a database access error
1946     *      occurred or this method was called on a closed
1947     *      {@code EnhancedPreparedStatement}.
1948     *  @throws SQLFeatureNotSupportedException  The JDBC driver does not
1949     *      support this method.
1950     */
1951    public void setNClob( final String parameterName, final Reader value ) throws SQLException;
1952
1953    /**
1954     *  <p>{@summary Sets the designated parameter to the given Java
1955     *  {@link String} value.}</p>
1956     *  <p>The driver converts this to an SQL {@code NCHAR}, {@code NVARCHAR},
1957     *  or {@code LONGNVARCHAR} value (depending on the argument's size
1958     *  relative to the driver's limits on {@code NVARCHAR} values)when it
1959     *  sends it to the database.</p>
1960     *  <p>For the logging, it is always {@code NCHAR}.</p>
1961     *
1962     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1963     *  @param  value   The parameter value.
1964     *  @throws SQLException    The parameter name did not correspond to any
1965     *      defined parameter in the SQL statement, the driver does not
1966     *      support national character sets, the driver detected that a data
1967     *      conversion error could occur, a database access error occurred or
1968     *      this method was called on a closed
1969     *      {@code EnhancedPreparedStatement}.
1970     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
1971     *      support this method.
1972     */
1973    public void setNString( final String parameterName, final String value ) throws SQLException;
1974
1975    /**
1976     *  Sets the designated parameter to SQL {@code NULL}.
1977     *
1978     *  @note   You must specify the parameter's SQL type.
1979     *
1980     *  @param  parameterName   The name of the parameter, prefixed by a colon.
1981     *  @param  sqlType The SQL type code.
1982     *  @throws SQLException    The parameter name did not correspond to any
1983     *      defined parameter in the SQL statement, a database access error
1984     *      occurred or this method was called on a closed
1985     *      {@code EnhancedPreparedStatement}.
1986     *  @throws SQLFeatureNotSupportedException The {@code sqlType} is a
1987     *      {@link java.sql.JDBCType#ARRAY},
1988     *      {@link java.sql.JDBCType#BLOB},
1989     *      {@link java.sql.JDBCType#CLOB},
1990     *      {@link java.sql.JDBCType#DATALINK},
1991     *      {@link java.sql.JDBCType#JAVA_OBJECT},
1992     *      {@link java.sql.JDBCType#NCHAR},
1993     *      {@link java.sql.JDBCType#NCLOB},
1994     *      {@link java.sql.JDBCType#NVARCHAR},
1995     *      {@link java.sql.JDBCType#LONGNVARCHAR},
1996     *      {@link java.sql.JDBCType#REF},
1997     *      {@link java.sql.JDBCType#ROWID},
1998     *      {@link java.sql.JDBCType#SQLXML}
1999     *      or
2000     *      {@link java.sql.JDBCType#STRUCT}
2001     *      data type and the JDBC driver does not support this data type.
2002     *
2003     *  @see    java.sql.JDBCType
2004     */
2005    public void setNull( final String parameterName, final SQLType sqlType ) throws SQLException;
2006
2007    /**
2008     *  <p>{@summary Sets the designated parameter to SQL {@code NULL}.}</p>
2009     *  <p>This version of the method {@code setNull()} should be used for
2010     *  user-defined types and REF type parameters. Examples of user-defined
2011     *  types include: {@code STRUCT}, {@code DISTINCT}, {@code JAVA_OBJECT},
2012     *  and named array types.</p>
2013     *  <p>Although this method is intended for user-defined and {@code REF}
2014     *  parameters, this method may be used to set a {@code null} parameter of
2015     *  any JDBC type. If the parameter does not have a user-defined or
2016     *  {@code REF} type, the given {@code typeName} is ignored.</p>
2017     *
2018     *  @note   To be portable, applications must give the SQL type code and
2019     *      the fully-qualified SQL type name when specifying a {@code NULL}
2020     *      user-defined or {@code REF} parameter. In the case of a
2021     *      user-defined type the name is the type name of the parameter
2022     *      itself. For a {@code REF} parameter, the name is the type name of
2023     *      the referenced type. If a JDBC driver does not need the type code
2024     *      or type name information, it may ignore it.
2025     *
2026     *  @param  parameterName   The name of the parameter, prefixed by a colon.
2027     *  @param  sqlType The SQL type code.
2028     *  @param typeName The fully-qualified name of an SQL user-defined type;
2029     *      ignored if the parameter is not a user-defined type or {@code REF}.
2030     *  @throws SQLException    The parameter name did not correspond to any
2031     *      defined parameter in the SQL statement, a database access error
2032     *      occurred or this method was called on a closed
2033     *      {@code EnhancedPreparedStatement}.
2034     *  @throws SQLFeatureNotSupportedException The {@code sqlType} is a
2035     *      {@link java.sql.JDBCType#ARRAY},
2036     *      {@link java.sql.JDBCType#BLOB},
2037     *      {@link java.sql.JDBCType#CLOB},
2038     *      {@link java.sql.JDBCType#DATALINK},
2039     *      {@link java.sql.JDBCType#JAVA_OBJECT},
2040     *      {@link java.sql.JDBCType#NCHAR},
2041     *      {@link java.sql.JDBCType#NCLOB},
2042     *      {@link java.sql.JDBCType#NVARCHAR},
2043     *      {@link java.sql.JDBCType#LONGNVARCHAR},
2044     *      {@link java.sql.JDBCType#REF},
2045     *      {@link java.sql.JDBCType#ROWID},
2046     *      {@link java.sql.JDBCType#SQLXML}
2047     *      or
2048     *      {@link java.sql.JDBCType#STRUCT}
2049     *      data type and the JDBC driver does not support this data type.
2050     */
2051    public void setNull ( final String parameterName, final SQLType sqlType, final String typeName ) throws SQLException;
2052
2053    /**
2054     *  <p>{@summary Sets the value of the designated parameter using the given
2055     *  object.}</p>
2056     *  <p>The JDBC specification specifies a standard mapping from Java
2057     *  {@code Object} types to SQL types.  The given argument will be
2058     *  converted to the corresponding SQL type before being sent to the
2059     *  database.</p>
2060     *  <p>Note that this method may be used to pass database- specific
2061     *  abstract data types, by using a driver-specific Java type.</p>
2062     *  <p>If the object is of a class implementing the interface
2063     *  {@link java.sql.SQLData},
2064     *  the JDBC driver should call the method {@code SQLData.writeSQL} to
2065     *  write it to the SQL data stream.</p>
2066     *  <p>If, on the other hand, the object is of a class implementing
2067     *  {@link java.sql.Ref},
2068     *  {@link java.sql.Blob},
2069     *  {@link java.sql.Clob},
2070     *  {@link java.sql.NClob},
2071     *  {@link java.sql.Struct},
2072     *  {@link java.net.URL},
2073     *  {@link java.sql.RowId},
2074     *  {@link java.sql.SQLXML}
2075     *  or
2076     *  {@link java.sql.Array},
2077     *  the driver should pass it to the database as a value of the
2078     *  corresponding SQL type.</p>
2079     *
2080     *  @note   Not all databases allow for a non-typed {@code NULL} to be sent
2081     *  to the backend. For maximum portability, the {@code setNull()} or the
2082     *  {@code setObject( final String parameterName, final Object x, int sqlType )}
2083     *  method should be used instead of {@code setObject( final String parameterName, final Object value )}
2084     *  with {@code value} set to {@code null}
2085     *
2086     *  @note   This method throws an exception if there is an ambiguity, for
2087     *      example, if the object is of a class implementing more than one of
2088     *      the interfaces named above.
2089     *
2090     *  @param  parameterName   The name of the parameter, prefixed by a colon.
2091     *  @param  value   The object containing the input parameter value.
2092     *  @throws SQLException    The parameter name did not correspond to any
2093     *      defined parameter in the SQL statement, a database access error
2094     *      occurred, this method was called on a closed
2095     *      {@code EnhancedPreparedStatement} or the type of the given object
2096     *      is ambiguous.
2097     */
2098    public void setObject( final String parameterName, final Object value ) throws SQLException;
2099
2100    /**
2101     *  <p>{@summary Sets the value of the designated parameter using the given
2102     *  object.}</p>
2103     *  <p>If the second argument is an
2104     *  {@link InputStream}
2105     *  or a
2106     *  {@link Reader}
2107     *  then the stream must contain the number of bytes specified by
2108     *  the {@code scaleOrLength} argument</p>.
2109     *  <p>If these conditions are not true the driver will generate a
2110     *  {@link SQLException}
2111     *  when the prepared statement is executed.</p>
2112     *  <p>The given Java object will be converted to the given
2113     *  {@code targetSqlType} before being sent to the database.</p>
2114     *  <p>If the object has a custom mapping (is of a class implementing the
2115     *  interface
2116     *  {@link java.sql.SQLData}),
2117     *  the JDBC driver should call the method
2118     *  {@link java.sql.SQLData#writeSQL(SQLOutput)}
2119     *  to write it to the SQL data stream.</p>
2120     *  <p>If, on the other hand, the object is of a class implementing
2121     *  {@link java.sql.Ref},
2122     *  {@link java.sql.Blob},
2123     *  {@link java.sql.Clob},
2124     *  {@link java.sql.NClob},
2125     *  {@link java.sql.Struct},
2126     *  {@link java.net.URL},
2127     *  or
2128     *  {@link java.sql.Array},
2129     *  the driver should pass it to the database as a value of the
2130     *  corresponding SQL type.</p>
2131     *  <p>Note that this method may be used to pass database-specific abstract
2132     *  data types.</p>
2133     *
2134     *  @param  parameterName   The name of the parameter, prefixed by a colon.
2135     *  @param  value   The object containing the input parameter value.
2136     *  @param  targetSqlType   The SQL type to be sent to the database. The
2137     *      scale argument may further qualify this type.
2138     *  @param  scaleOrLength   For
2139     *      {@link java.sql.JDBCType#DECIMAL}
2140     *      or
2141     *      {@link java.sql.JDBCType#NUMERIC}
2142     *      types, this is the number of digits after the decimal point. For
2143     *      Java Object types
2144     *      {@link InputStream}
2145     *      and
2146     *      {@link Reader},
2147     *      this is the length of the data in the stream or reader. For all
2148     *      other types, this value will be ignored.
2149     *  @throws SQLException    The parameter name did not correspond to any
2150     *      defined parameter in the SQL statement, a database access error
2151     *      occurred, this method was called on a closed
2152     *      {@code EnhancedPreparedStatement} or the Java Object specified by
2153     *      {@code value} is an {@code InputStream} or {@code Reader} instance
2154     *      and the value of the scale parameter is less than zero.
2155     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
2156     *      support the specified {@code targetSqlType}.
2157     *
2158     *  @see    JDBCType
2159     *  @see    SQLType
2160     */
2161    public void setObject( final String parameterName, final Object value, SQLType targetSqlType, int scaleOrLength) throws SQLException;
2162
2163    /**
2164     *  <p>{@summary Sets the value of the designated parameter with the given
2165     *  object.}</p>
2166     *  <p>This method is similar to
2167     *  {@link #setObject(String,Object,SQLType,int)},
2168     *  except that it assumes a scale of zero.</p>
2169     *
2170     *  @param  parameterName   The name of the parameter, prefixed by a colon.
2171     *  @param  value   The object containing the input parameter value.
2172     *  @param  targetSqlType   The SQL type to be sent to the database. The
2173     *      scale argument may further qualify this type.
2174     *  @throws SQLException    The parameter name did not correspond to any
2175     *      defined parameter in the SQL statement, a database access error
2176     *      occurred, or this method was called on a closed
2177     *      {@code EnhancedPreparedStatement}.
2178     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
2179     *      support the specified {@code targetSqlType}.
2180     *
2181     *  @see    JDBCType
2182     *  @see    SQLType
2183     */
2184    public void setObject( final String parameterName, final Object value, SQLType targetSqlType ) throws SQLException;
2185
2186    /**
2187     *  <p>{@summary Sets the number of seconds the driver will wait for a
2188     *  {@link java.sql.Statement}
2189     *  instance to execute to the given number of seconds.} By default there
2190     *  is no limit on the amount of time allowed for a running statement to
2191     *  complete.</p>
2192     *  <p>If the limit is exceeded, an
2193     *  {@link SQLTimeoutException}
2194     *  is thrown.</p>
2195     *  <p>A JDBC driver must apply this limit to the
2196     *  {@link java.sql.Statement#execute(String)},
2197     *  {@link java.sql.Statement#executeQuery(String)}
2198     *  and
2199     *  {@link java.sql.Statement#executeUpdate(String)}
2200     *  methods.</p>
2201     *
2202     *  @note   JDBC driver implementations may also apply this limit to
2203     *      {@code ResultSet} methods (consult your driver vendor documentation
2204     *      for details).
2205     *
2206     *  @note   In the case of {@code Statement} batching, it is implementation
2207     *      defined whether the time-out is applied to individual SQL commands
2208     *      added via the {@code #addBatch()} method or to the entire batch of
2209     *      SQL commands invoked by the {@code executeBatch()} method (consult
2210     *      your driver vendor documentation for details).
2211     *
2212     *  @param  timeout The new query timeout limit in seconds; zero means
2213     *      there is no limit
2214     *  @throws SQLException    A database access error occurred, this method
2215     *      was called on a closed {@code EnhancedPreparedStatement} or the
2216     *      condition {@code seconds >= 0} is not satisfied
2217     *
2218     *  @see    #getQueryTimeout()
2219     */
2220    public void setQueryTimeout( final int timeout ) throws SQLException;
2221
2222    /**
2223     *  <p>{@summary Sets the designated parameter to the given
2224     *  {@link java.sql.JDBCType#REF REF(&lt;structured-type&gt;)}
2225     *  value.}</p>
2226     *  <p>The driver converts this to an SQL {@code REF} value when it
2227     *  sends it to the database.</p>
2228     *
2229     *  @param  parameterName   The name of the parameter, prefixed by a colon.
2230     *  @param  value   The parameter value.
2231     *  @throws SQLException    The parameter name did not correspond to any
2232     *      defined parameter in the SQL statement, a database access error
2233     *      occurred or this method was called on a closed
2234     *      {@code EnhancedPreparedStatement}.
2235     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
2236     *      support this method.
2237     */
2238    public void setRef ( final String parameterName, final Ref value ) throws SQLException;
2239
2240    /**
2241     *  <p>{@summary Sets the designated parameter to the given
2242     *  {@link java.sql.RowId}
2243     *  instance.}</p>
2244     *  <p>The driver converts this to an SQL {@code ROWID} value when it
2245     *  sends it to the database.</p>
2246     *
2247     *  @param  parameterName   The name of the parameter, prefixed by a colon.
2248     *  @param  value   The parameter value.
2249     *  @throws SQLException    The parameter name did not correspond to any
2250     *      defined parameter in the SQL statement, a database access error
2251     *      occurred or this method was called on a closed
2252     *      {@code EnhancedPreparedStatement}.
2253     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
2254     *      support this method.
2255     */
2256    public void setRowId( final String parameterName, final RowId value ) throws SQLException;
2257
2258    /**
2259     *  <p>{@summary Sets the designated parameter to the given Java
2260     *  {@code short} value.}</p>
2261     *  <p>The driver converts this to an SQL {@code SMALLINT} value when it
2262     *  sends it to the database.</p>
2263     *
2264     *  @param  parameterName   The name of the parameter, prefixed by a colon.
2265     *  @param  value   The parameter value.
2266     *  @throws SQLException    The parameter name did not correspond to any
2267     *      defined parameter in the SQL statement, a database access error
2268     *      occurred or this method was called on a closed
2269     *      {@code EnhancedPreparedStatement}.
2270     */
2271    public void setShort( final String parameterName, final short value ) throws SQLException;
2272
2273    /**
2274     *  <p>{@summary Sets the designated parameter to the given
2275     *  {@link java.sql.SQLXML} value.}</p>
2276     *  <p>The driver converts this to an SQL {@code SQLXML} value when it
2277     *  sends it to the database.</p>
2278     *
2279     *  @param  parameterName   The name of the parameter, prefixed by a colon.
2280     *  @param  value   An {@code SQLXML} instance that maps an SQL
2281     *      {@code SQLXML} value.
2282     *  @throws SQLException    The parameter name did not correspond to any
2283     *      defined parameter in the SQL statement, a database access error
2284     *      occurred, this method was called on a closed
2285     *      {@code EnhancedPreparedStatement}, or the
2286     *      {@link javax.xml.transform.Result},
2287     *      {@link java.io.Writer}
2288     *      or
2289     *      {@link java.io.OutputStream}
2290     *      was closed for the {@code SQLXML} object.
2291     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
2292     *      support this method.
2293     */
2294    void setSQLXML( final String parameterName, final SQLXML value ) throws SQLException;
2295
2296    /**
2297     *  <p>{@summary Sets the designated parameter to the given Java
2298     *  {@link java.lang.String}
2299     *  value.}</p>
2300     *  <p>The driver converts this to an SQL {@code VARCHAR} or
2301     *  {@code LONGVARCHAR} value (depending on the argument's size relative to the
2302     *  driver's limits on {@code VARCHAR} values) when it sends it to the
2303     *  database.</p>
2304     *  <p>For the logging, it is always {@code VARCHAR}.</p>
2305     *
2306     *  @param  parameterName   The name of the parameter, prefixed by a colon.
2307     *  @param  value   The parameter value.
2308     *  @throws SQLException    The parameter name did not correspond to any
2309     *      defined parameter in the SQL statement, a database access error
2310     *      occurred or this method was called on a closed
2311     *      {@code EnhancedPreparedStatement}.
2312     */
2313    public void setString( final String parameterName, final String value ) throws SQLException;
2314
2315    /**
2316     *  <p>{@summary Sets the designated parameter to the given
2317     *  {@link java.sql.Time}
2318     *  value.}</p>
2319     *  <p>The driver converts this to an SQL {@code TIME} value when it
2320     *  sends it to the database.</p>
2321     *
2322     *  @param  parameterName   The name of the parameter, prefixed by a colon.
2323     *  @param  value   The parameter value.
2324     *  @throws SQLException    The parameter name did not correspond to any
2325     *      defined parameter in the SQL statement, a database access error
2326     *      occurred or this method was called on a closed
2327     *      {@code EnhancedPreparedStatement}.
2328     */
2329    public void setTime( final String parameterName, final Time value ) throws SQLException;
2330
2331    /**
2332     *  <p>{@summary Sets the designated parameter to the given
2333     *  {@link java.sql.Time}
2334     *  value using the given
2335     *  {@link java.util.Calendar}
2336     *  instance.} The driver used the {@code Calendar} instance to construct
2337     *  an SQL {@code TIME} value, which the driver then sends to the database.
2338     *  With the {@code Calendar} instance, the driver can calculate the date
2339     *  taking into account a custom timezone. If no {@code Calendar} instance
2340     *  is specified, the driver uses the default timezone, which is that of
2341     *  the virtual machine running the application.</p>
2342     *
2343     *  @param  parameterName   The name of the parameter, prefixed by a colon.
2344     *  @param  value   The parameter value.
2345     *  @param  calendar    The {@code Calendar} instance the driver will use
2346     *      to construct the date.
2347     *  @throws SQLException    The parameter name did not correspond to any
2348     *      defined parameter in the SQL statement, a database access error
2349     *      occurred or this method was called on a closed
2350     *      {@code EnhancedPreparedStatement}.
2351     */
2352    @SuppressWarnings( "UseOfObsoleteDateTimeApi" )
2353    public void setTime( final String parameterName, final Time value, final Calendar calendar ) throws SQLException;
2354
2355    /**
2356     *  <p>{@summary Sets the designated parameter to the given
2357     *  {@link java.sql.Timestamp}
2358     *  value.}</p>
2359     *  <p>The driver converts this to an SQL {@code TIMESTAMP} value when it
2360     *  sends it to the database.</p>
2361     *
2362     *  @param  parameterName   The name of the parameter, prefixed by a colon.
2363     *  @param  value   The parameter value.
2364     *  @throws SQLException    The parameter name did not correspond to any
2365     *      defined parameter in the SQL statement, a database access error
2366     *      occurred or this method was called on a closed
2367     *      {@code EnhancedPreparedStatement}.
2368     */
2369    public void setTimestamp( final String parameterName, final Timestamp value ) throws SQLException;
2370
2371    /**
2372     *  <p>{@summary Sets the designated parameter to the given
2373     *  {@link java.sql.Timestamp}
2374     *  value using the given
2375     *  {@link java.util.Calendar}
2376     *  instance.} The driver used the {@code Calendar} instance to construct
2377     *  an SQL {@code TIMESTAMP} value, which the driver then sends to the
2378     *  database. With the {@code Calendar} instance, the driver can calculate
2379     *  the timestamp taking into account a custom timezone. If no
2380     *  {@code Calendar} instance is specified, the driver uses the default
2381     *  timezone, which is that of the virtual machine running the
2382     *  application.</p>
2383     *
2384     *  @param  parameterName   The name of the parameter, prefixed by a colon.
2385     *  @param  value   The parameter value.
2386     *  @param  calendar    The {@code Calendar} instance the driver will use
2387     *      to construct the date.
2388     *  @throws SQLException    The parameter name did not correspond to any
2389     *      defined parameter in the SQL statement, a database access error
2390     *      occurred or this method was called on a closed
2391     *      {@code EnhancedPreparedStatement}.
2392     */
2393    @SuppressWarnings( "UseOfObsoleteDateTimeApi" )
2394    public void setTimestamp( final String parameterName, final Timestamp value, final Calendar calendar ) throws SQLException;
2395
2396    /**
2397     *  <p>{@summary Sets the designated parameter to the given
2398     *  {@link java.net.URL}
2399     *  value.}</p>
2400     *  <p>The driver converts this to an SQL {@code DATALINK} value when it
2401     *  sends it to the database.</p>
2402     *
2403     *  @param  parameterName   The name of the parameter, prefixed by a colon.
2404     *  @param  value   The parameter value.
2405     *  @throws SQLException    The parameter name did not correspond to any
2406     *      defined parameter in the SQL statement, a database access error
2407     *      occurred or this method was called on a closed
2408     *      {@code EnhancedPreparedStatement}.
2409     *  @throws SQLFeatureNotSupportedException The JDBC driver does not
2410     *      support this method.
2411     */
2412    public void setURL( final String parameterName, final URL value ) throws SQLException;
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598    //--------------------------JDBC 4.1 -----------------------------
2599
2600
2601    //--------------------------JDBC 4.2 -----------------------------
2602}
2603//  interface EnhancedPreparedStatement
2604
2605/*
2606 *  End of File
2607 */