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 thisPreparedStatementobject, 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 returnedPublisherpublishes the update counts.java.util.concurrent.Flow.Publisher<? extends java.sql.ResultSet>executeQueryAsyncOracle()Executes the SQL query in thisPreparedStatementobject asynchronously and returns aPublisherwhich publishes a singleResultSetcontaining 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.SQLExceptionAsynchronously executes the SQL statement in thisPreparedStatementobject, which may be any kind of SQL statement. This method returns aPublisherthat publishes a singleBooleanto indicate the form of the first result. The returnedPublisherpublishesBoolean.TRUEwhen execution of the SQL is completed and the result is aResultSet. It publishesBoolean.FALSEwhen 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:getResultSetorgetUpdateCount. You must callgetMoreResultsto move to any subsequent result(s).The returned
PublishercallsonErrorwith aSQLTimeoutExceptionwhen the driver has determined that the timeout value that was specified by thesetQueryTimeoutmethod has been exceeded and has at least attempted to cancel the currently runningStatement. It callsonErrorwithSQLExceptionif 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
PreparedStatementexceptcancel,isClosed, or one defined byObjectafter this method is called will block until the returnedPublishercallsonCompleteoronError.- Returns:
- a
Publisherthat publishesBoolean.TRUEif the first result is aResultSetobject;Boolean.FALSEif 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.SQLExceptionExecutes the SQL query in thisPreparedStatementobject asynchronously and returns aPublisherwhich publishes a singleResultSetcontaining the rows produced.If the query produces an error or if the query does not produce a set of rows, the
PublishercallsonErrorwith aSQLExceptioncorresponding to the error.The returned
PublishercallsonErrorwith aSQLTimeoutExceptionwhen the driver has determined that the timeout value that was specified by thesetQueryTimeoutmethod has been exceeded and has at least attempted to cancel the currently runningStatement. It callsonErrorwithSQLExceptionif a database access error occurs.Calling any method of this
PreparedStatementexceptcancel,isClosed, or one defined byObjectafter this method is called will block until the returnedPublishercallsonCompleteoronError.- Returns:
- a
Publisherof theResultSet - Throws:
java.sql.SQLException- if a database access error occurs; this method is called on a closedPreparedStatementor the implementation detects that the SQL statement does not return aResultSetobject- Since:
- 20
-
executeUpdateAsyncOracle
java.util.concurrent.Flow.Publisher<java.lang.Long> executeUpdateAsyncOracle() throws java.sql.SQLExceptionAsynchronously 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 aPublisherwhich publishes a single count of the number of rows modified. If the SQL statement returns nothing the returnedPublisherpublishes 0. If the statement produces an error or if the statement produces a set of rows, thePublishercallsonErrorwith aSQLExceptioncorresponding to the error.The returned
PublishercallsonErrorwith aSQLTimeoutExceptionwhen the driver has determined that the timeout value that was specified by thesetQueryTimeoutmethod has been exceeded and has at least attempted to cancel the currently runningStatement. It is callsonErrorwithSQLExceptionif a access error occurs.Calling any method of this
PreparedStatementexceptcancel,isClosed, or one defined byObjectafter this method is called will block until the returnedPublishercallsonCompleteoronError.- Returns:
- a
Publisherof the count of rows modified - Throws:
java.sql.SQLException- if a database access error occurs; this method is called on a closedPreparedStatementor the implementation detects that the SQL statement returns aResultSetobject- Since:
- 20
-
executeBatchAsyncOracle
java.util.concurrent.Flow.Publisher<java.lang.Long> executeBatchAsyncOracle() throws java.sql.SQLExceptionSubmits a batch of commands to the database for asynchronous execution and if all commands execute successfully, the returnedPublisherpublishes the update counts. The publishedLongvalues 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
PublishercallsonErrorwith 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.getUpdateCountswill 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
PublishercallsonErrorwith aBatchUpdateExceptionwhen the driver has determined that the timeout value that was specified by thesetQueryTimeoutmethod has been exceeded and has at least attempted to cancel the currently runningStatement. It callsonErrorwithSQLExceptionif a database access error occurs.Calling any method of this
PreparedStatementexceptcancel,isClosed, or one defined byObjectafter this method is called will block until the returnedPublishercallsonCompleteoronError.- Returns:
- a Publisher that publishes one
Longfor each command in the batch. The elements are published in the order in which commands were added to the batch. If a command fails thePublishercallsonErrorwith theSQLExceptionthat caused the failure. - Throws:
java.sql.SQLException- if a database access error occurs, this method is called on a closedPreparedStatementor 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
-
-