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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.Flow.Publisher<java.lang.Boolean>
executeAsyncOracle()
Asynchronously executes the SQL statement in thisPreparedStatement
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 returnedPublisher
publishes the update counts.java.util.concurrent.Flow.Publisher<? extends java.sql.ResultSet>
executeQueryAsyncOracle()
Executes the SQL query in thisPreparedStatement
object asynchronously and returns aPublisher
which publishes a singleResultSet
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
-
-
-
-
Method Detail
-
executeAsyncOracle
java.util.concurrent.Flow.Publisher<java.lang.Boolean> executeAsyncOracle() throws java.sql.SQLException
Asynchronously executes the SQL statement in thisPreparedStatement
object, which may be any kind of SQL statement. This method returns aPublisher
that publishes a singleBoolean
to indicate the form of the first result. The returnedPublisher
publishesBoolean.TRUE
when execution of the SQL is completed and the result is aResultSet
. It publishesBoolean.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
orgetUpdateCount
. You must callgetMoreResults
to move to any subsequent result(s).The returned
Publisher
callsonError
with aSQLTimeoutException
when the driver has determined that the timeout value that was specified by thesetQueryTimeout
method has been exceeded and has at least attempted to cancel the currently runningStatement
. It callsonError
withSQLException
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 useexecuteUpdateAsyncOracle()
.Calling any method of this
PreparedStatement
exceptcancel
,isClosed
, or one defined byObject
after this method is called will block until the returnedPublisher
callsonComplete
oronError
.- Returns:
- a
Publisher
that publishesBoolean.TRUE
if the first result is aResultSet
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 closedPreparedStatement
- Since:
- 20
-
executeQueryAsyncOracle
java.util.concurrent.Flow.Publisher<? extends java.sql.ResultSet> executeQueryAsyncOracle() throws java.sql.SQLException
Executes the SQL query in thisPreparedStatement
object asynchronously and returns aPublisher
which publishes a singleResultSet
containing the rows produced.If the query produces an error or if the query does not produce a set of rows, the
Publisher
callsonError
with aSQLException
corresponding to the error.The returned
Publisher
callsonError
with aSQLTimeoutException
when the driver has determined that the timeout value that was specified by thesetQueryTimeout
method has been exceeded and has at least attempted to cancel the currently runningStatement
. It callsonError
withSQLException
if a database access error occurs.Calling any method of this
PreparedStatement
exceptcancel
,isClosed
, or one defined byObject
after this method is called will block until the returnedPublisher
callsonComplete
oronError
.- Returns:
- a
Publisher
of theResultSet
- Throws:
java.sql.SQLException
- if a database access error occurs; this method is called on a closedPreparedStatement
or the implementation detects that the SQL statement does not return aResultSet
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 aPublisher
which publishes a single count of the number of rows modified. If the SQL statement returns nothing the returnedPublisher
publishes 0. If the statement produces an error or if the statement produces a set of rows, thePublisher
callsonError
with aSQLException
corresponding to the error.The returned
Publisher
callsonError
with aSQLTimeoutException
when the driver has determined that the timeout value that was specified by thesetQueryTimeout
method has been exceeded and has at least attempted to cancel the currently runningStatement
. It is callsonError
withSQLException
if a access error occurs.Calling any method of this
PreparedStatement
exceptcancel
,isClosed
, or one defined byObject
after this method is called will block until the returnedPublisher
callsonComplete
oronError
.- 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 closedPreparedStatement
or the implementation detects that the SQL statement returns aResultSet
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 returnedPublisher
publishes the update counts. The publishedLong
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:- 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
- A value of
SUCCESS_NO_INFO
-- indicates that the command was processed successfully but that the number of rows affected is unknownIf one of the commands in a batch update fails to execute properly, the returned
Publisher
callsonError
with aBatchUpdateException
. 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 methodBatchUpdateException.getUpdateCounts
will contain as many elements as there are commands in the batch, and at least one of the elements will be the following: - 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
callsonError
with aBatchUpdateException
when the driver has determined that the timeout value that was specified by thesetQueryTimeout
method has been exceeded and has at least attempted to cancel the currently runningStatement
. It callsonError
withSQLException
if a database access error occurs.Calling any method of this
PreparedStatement
exceptcancel
,isClosed
, or one defined byObject
after this method is called will block until the returnedPublisher
callsonComplete
oronError
.- 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 thePublisher
callsonError
with theSQLException
that caused the failure. - Throws:
java.sql.SQLException
- if a database access error occurs, this method is called on a closedPreparedStatement
or the driver does not support batch statements. ThrowsBatchUpdateException
(a subclass ofSQLException
) if the implementation detects that one of the commands sent to the database returns a result set.- Since:
- 20
-
-