Package oracle.jdbc

## Interface OracleCommonPreparedStatement

All Superinterfaces:
  `java.lang.AutoCloseable`, `OracleCommonStatement`, `java.sql.PreparedStatement`, `java.sql.Statement`, `java.sql.Wrapper`

All Known Subinterfaces:
  `OracleCallableStatement`, `OraclePreparedStatement`

    public interface OracleCommonPreparedStatement
    extends java.sql.PreparedStatement, OracleCommonStatement

Interface that defines common methods.

Since:
  23

### Field Summary

### Fields inherited from interface java.sql.Statement

`CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO`

### Method Summary

All Methods Instance Methods Abstract Methods
`java.util.concurrent.Flow.Publisher<java.lang.Boolean>` `executeAsyncOracle()` Asynchronously executes the SQL statement in this `PreparedStatement` object, which may be any kind of SQL statement.
`java.util.concurrent.Flow.Publisher<java.lang.Long>` `executeBatchAsyncOracle()` Submits a batch of commands to the database for asynchronous execution and if all commands execute successfully, the returned `Publisher` publishes the update counts.
`java.util.concurrent.Flow.Publisher<? extends java.sql.ResultSet>` `executeQueryAsyncOracle()` Executes the SQL query in this `PreparedStatement` object asynchronously and returns a `Publisher` which publishes a single `ResultSet` containing the rows produced.
`java.util.concurrent.Flow.Publisher<java.lang.Long>` `executeUpdateAsyncOracle()` Asynchronously executes the SQL statement in this PreparedStatement object, which must be a SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement.

### Methods inherited from interface oracle.jdbc.OracleCommonStatement

`continueOnError`

### Methods inherited from interface java.sql.PreparedStatement

`addBatch, clearParameters, execute, executeLargeUpdate, executeQuery, executeUpdate, getMetaData, getParameterMetaData, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setObject, setObject, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURL`

### Methods inherited from interface java.sql.Statement

`addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeBatch, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout`

### Methods inherited from interface java.sql.Wrapper

`isWrapperFor, unwrap`

### Method Detail

#### executeAsyncOracle

    java.util.concurrent.Flow.Publisher<java.lang.Boolean> executeAsyncOracle()
                                                                       throws java.sql.SQLException

Asynchronously executes the SQL statement in this `PreparedStatement` object, which may be any kind of SQL statement. This method returns a `Publisher` that publishes a single `Boolean` to indicate the form of the first result. The returned `Publisher` publishes `Boolean.TRUE` when execution of the SQL is completed and the result is a `ResultSet`. It publishes `Boolean.FALSE` when execution of the SQL is completed and the result is an update count or there is no result. You must call one of the get result methods to retrieve the results: `getResultSet` or `getUpdateCount`. You must call `getMoreResults` to move to any subsequent result(s).

The returned `Publisher` calls `onError` with a `SQLTimeoutException` when the driver has determined that the timeout value that was specified by the `setQueryTimeout` method has been exceeded and has at least attempted to cancel the currently running `Statement`. It calls `onError` with `SQLException` if a database access error occurs.

This method is primarily used for executing DDL or stored procedure calls. To execute queries use `executeQueryAsyncOracle()`. To execute DML use `executeUpdateAsyncOracle()`.

Calling any method of this `PreparedStatement` except `cancel`, `isClosed`, or one defined by `Object` after this method is called will block until the returned `Publisher` calls `onComplete` or `onError`.

Returns:
  a `Publisher` that publishes `Boolean.TRUE` if the first result is a `ResultSet` object; `Boolean.FALSE` if the first result is an update count or there is no result
Throws:
  `java.sql.SQLException` - if a database error occurs or this method is called on a closed `PreparedStatement`
Since:
  20

#### executeQueryAsyncOracle

    java.util.concurrent.Flow.Publisher<? extends java.sql.ResultSet> executeQueryAsyncOracle()
                                                                                       throws java.sql.SQLException

Executes the SQL query in this `PreparedStatement` object asynchronously and returns a `Publisher` which publishes a single `ResultSet` containing the rows produced.

If the query produces an error or if the query does not produce a set of rows, the `Publisher` calls `onError` with a `SQLException` corresponding to the error.

The returned `Publisher` calls `onError` with a `SQLTimeoutException` when the driver has determined that the timeout value that was specified by the `setQueryTimeout` method has been exceeded and has at least attempted to cancel the currently running `Statement`. It calls `onError` with `SQLException` if a database access error occurs.

Calling any method of this `PreparedStatement` except `cancel`, `isClosed`, or one defined by `Object` after this method is called will block until the returned `Publisher` calls `onComplete` or `onError`.

Returns:
  a `Publisher` of the `ResultSet`
Throws:
  `java.sql.SQLException` - if a database access error occurs; this method is called on a closed `PreparedStatement` or the implementation detects that the SQL statement does not return a `ResultSet` object
Since:
  20

#### executeUpdateAsyncOracle

    java.util.concurrent.Flow.Publisher<java.lang.Long> executeUpdateAsyncOracle()
                                                                          throws java.sql.SQLException

Asynchronously executes the SQL statement in this PreparedStatement object, which must be a SQL Data Manipulation Language (DML) statement, such as INSERT, UPDATE or DELETE; or an SQL statement that returns nothing, such as a DDL statement. Returns a `Publisher` which publishes a single count of the number of rows modified. If the SQL statement returns nothing the returned `Publisher` publishes 0. If the statement produces an error or if the statement produces a set of rows, the `Publisher` calls `onError` with a `SQLException` corresponding to the error.

The returned `Publisher` calls `onError` with a `SQLTimeoutException` when the driver has determined that the timeout value that was specified by the `setQueryTimeout` method has been exceeded and has at least attempted to cancel the currently running `Statement`. It is calls `onError` with `SQLException` if a access error occurs.

Calling any method of this `PreparedStatement` except `cancel`, `isClosed`, or one defined by `Object` after this method is called will block until the returned `Publisher` calls `onComplete` or `onError`.

Returns:
  a `Publisher` of the count of rows modified
Throws:
  `java.sql.SQLException` - if a database access error occurs; this method is called on a closed `PreparedStatement` or the implementation detects that the SQL statement returns a `ResultSet` object
Since:
  20

#### executeBatchAsyncOracle

    java.util.concurrent.Flow.Publisher<java.lang.Long> executeBatchAsyncOracle()
                                                                         throws java.sql.SQLException

Submits a batch of commands to the database for asynchronous execution and if all commands execute successfully, the returned `Publisher` publishes the update counts. The published `Long` values are published in the order corresponding to the commands in the batch, which are ordered according to the order in which they were added to the batch. The published values may be one of the following:

1. A number greater than or equal to zero -- indicates that the command was processed successfully and is an update count giving the number of rows in the database that were affected by the command's execution
2. A value of `SUCCESS_NO_INFO` -- indicates that the command was processed successfully but that the number of rows affected is unknown

   If one of the commands in a batch update fails to execute properly, the returned `Publisher` calls `onError` with a `BatchUpdateException`. After such a failure a JDBC driver may or may not continue to process the remaining commands in the batch. However, the driver's behavior must be consistent with a particular DBMS, either always continuing to process commands or never continuing to process commands. If the driver continues processing after a failure, the array returned by the method `BatchUpdateException.getUpdateCounts` will contain as many elements as there are commands in the batch, and at least one of the elements will be the following:

3. A value of `EXECUTE_FAILED` -- indicates that the command failed to execute successfully and occurs only if a driver continues to process commands after a command fails

The returned `Publisher` calls `onError` with a `BatchUpdateException` when the driver has determined that the timeout value that was specified by the `setQueryTimeout` method has been exceeded and has at least attempted to cancel the currently running `Statement`. It calls `onError` with `SQLException` if a database access error occurs.

Calling any method of this `PreparedStatement` except `cancel`, `isClosed`, or one defined by `Object` after this method is called will block until the returned `Publisher` calls `onComplete` or `onError`.

Returns:
  a Publisher that publishes one `Long` for each command in the batch. The elements are published in the order in which commands were added to the batch. If a command fails the `Publisher` calls `onError` with the `SQLException` that caused the failure.
Throws:
  `java.sql.SQLException` - if a database access error occurs, this method is called on a closed `PreparedStatement` or the driver does not support batch statements. Throws `BatchUpdateException` (a subclass of `SQLException`) if the implementation detects that one of the commands sent to the database returns a result set.
Since:
  20