Class MariaDbProcedureStatement

All Implemented Interfaces:
AutoCloseable, Cloneable, CallableStatement, PreparedStatement, Statement, Wrapper, CloneableCallableStatement

public class MariaDbProcedureStatement extends CallableProcedureStatement implements CloneableCallableStatement
  • Field Details

  • Constructor Details

    • MariaDbProcedureStatement

      public MariaDbProcedureStatement(String query, MariaDbConnection connection, String procedureName, String database, int resultSetType, int resultSetConcurrency, ExceptionFactory exceptionFactory) throws SQLException
      Specific implementation of CallableStatement to handle function call, represent by call like {?= call procedure-name[(arg1,arg2, ...)]}.
      Parameters:
      query - query
      connection - current connection
      procedureName - procedure name
      database - database
      resultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
      resultSetConcurrency - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
      exceptionFactory - Exception Factory
      Throws:
      SQLException - exception
  • Method Details

    • setParamsAccordingToSetArguments

      private void setParamsAccordingToSetArguments()
    • setInputOutputParameterMap

      private void setInputOutputParameterMap()
    • getOutputResult

      protected SelectResultSet getOutputResult() throws SQLException
      Specified by:
      getOutputResult in class CallableProcedureStatement
      Throws:
      SQLException
    • clone

      Clone statement.
      Specified by:
      clone in interface CloneableCallableStatement
      Overrides:
      clone in class CallableProcedureStatement
      Parameters:
      connection - connection
      Returns:
      Clone statement.
      Throws:
      CloneNotSupportedException - if any error occur.
    • retrieveOutputResult

      private void retrieveOutputResult() throws SQLException
      Throws:
      SQLException
    • setParameter

      public void setParameter(int parameterIndex, ParameterHolder holder) throws SQLException
      Overrides:
      setParameter in class ServerSidePreparedStatement
      Throws:
      SQLException
    • execute

      public boolean execute() throws SQLException
      Specified by:
      execute in interface PreparedStatement
      Overrides:
      execute in class ServerSidePreparedStatement
      Throws:
      SQLException
    • validAllParameters

      private void validAllParameters() throws SQLException
      Valid that all parameters are set.
      Throws:
      SQLException - if set parameters is not right
    • executeBatch

      public int[] executeBatch() throws SQLException
      Description copied from class: ServerSidePreparedStatement
      Submits a batch of send to the database for execution and if all send execute successfully, returns an array of update counts. The int elements of the array that is returned are ordered to correspond to the send in the batch, which are ordered according to the order in which they were added to the batch. The elements in the array returned by the method executeBatch 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 send in a batch update fails to execute properly, this method throws a BatchUpdateException , and a JDBC driver may or may not continue to process the remaining send in the batch. However, the driver's behavior must be consistent with a particular DBMS, either always continuing to process send or never continuing to process send. If the driver continues processing after a failure, the array returned by the method BatchUpdateException.getUpdateCounts will contain as many elements as there are send 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 send after a command fails

      The possible implementations and return values have been modified in the Java 2 SDK, Standard Edition, version 1.3 to accommodate the option of continuing to proccess send in a batch update after a BatchUpdateException object has been thrown.

      Specified by:
      executeBatch in interface Statement
      Overrides:
      executeBatch in class ServerSidePreparedStatement
      Returns:
      an array of update counts containing one element for each command in the batch. The elements of the array are ordered according to the order in which send were added to the batch.
      Throws:
      SQLException - if a database access error occurs, this method is called on a closed Statement or the driver does not support batch statements. Throws BatchUpdateException (a subclass of SQLException) if one of the send sent to the database fails to execute properly or attempts to return a result set.
      See Also: