Class PreparableStatement<RES_T>

java.lang.Object
com.mysql.cj.xdevapi.PreparableStatement<RES_T>
Type Parameters:
RES_T - result interface
Direct Known Subclasses:
FilterableStatement

public abstract class PreparableStatement<RES_T>
extends java.lang.Object
Abstract class, common to all X DevAPI statement classes that can be prepared.
  • Field Details

  • Constructor Details

  • Method Details

    • getMessageBuilder

      protected XMessageBuilder getMessageBuilder()
      Helper method to return an XMessageBuilder instance from MysqlxSession in use.
      Returns:
      the XMessageBuilder instance from current MysqlxSession
    • resetPrepareState

      protected void resetPrepareState()
      Mark this preparable statement to be deallocated on next execution, if it is currently prepared, or cancel the next prepare.
    • setReprepareState

      protected void setReprepareState()
      Mark this preparable statement to be deallocated and re-prepared on next execution, if it is currently prepared.
    • execute

      public RES_T execute()
      Executes synchronously this statement either directly or using prepared statements if: 1. Prepared statements are supported by the server. 2. The statement is executed repeatedly without changing its structure.
      Returns:
      the object returned from the low level statement execution
    • executeStatement

      protected abstract RES_T executeStatement()
      Executes the statement directly (non-prepared). Implementation is dependent on the statement type.
      Returns:
      the object returned from the lower level statement execution
    • getPrepareStatementXMessage

      protected abstract XMessage getPrepareStatementXMessage()
      Returns the XMessage needed to prepare this statement. Implementation is dependent on the statement type.
      Returns:
      the XMessage that prepares this statement
    • executePreparedStatement

      protected abstract RES_T executePreparedStatement()
      Executes a previously server-prepared statement. Implementation is dependent on the statement type.
      Returns:
      the object returned from the lower level statement execution
    • deallocatePrepared

      protected void deallocatePrepared()
      Deallocate this prepared statement from current MysqlxSession.