Class CommandRemote

java.lang.Object
org.h2.command.CommandRemote
All Implemented Interfaces:
AutoCloseable, CommandInterface

public class CommandRemote extends Object implements CommandInterface
Represents the client-side part of a SQL statement. This class is not used in embedded mode.
  • Field Details

    • transferList

      private final ArrayList<Transfer> transferList
    • parameters

      private final ArrayList<ParameterInterface> parameters
    • trace

      private final Trace trace
    • sql

      private final String sql
    • fetchSize

      private final int fetchSize
    • session

      private SessionRemote session
    • id

      private int id
    • isQuery

      private boolean isQuery
    • cmdType

      private int cmdType
    • readonly

      private boolean readonly
    • created

      private final int created
  • Constructor Details

  • Method Details

    • stop

      public void stop()
      Description copied from interface: CommandInterface
      Stop the command execution, release all locks and resources
      Specified by:
      stop in interface CommandInterface
    • prepare

      private void prepare(SessionRemote s, boolean createParams)
    • isQuery

      public boolean isQuery()
      Description copied from interface: CommandInterface
      Check if this is a query.
      Specified by:
      isQuery in interface CommandInterface
      Returns:
      true if it is a query
    • getParameters

      public ArrayList<ParameterInterface> getParameters()
      Description copied from interface: CommandInterface
      Get the parameters (if any).
      Specified by:
      getParameters in interface CommandInterface
      Returns:
      the parameters
    • prepareIfRequired

      private void prepareIfRequired()
    • getMetaData

      public ResultInterface getMetaData()
      Description copied from interface: CommandInterface
      Get an empty result set containing the meta data of the result.
      Specified by:
      getMetaData in interface CommandInterface
      Returns:
      the empty result
    • executeQuery

      public ResultInterface executeQuery(long maxRows, boolean scrollable)
      Description copied from interface: CommandInterface
      Execute the query.
      Specified by:
      executeQuery in interface CommandInterface
      Parameters:
      maxRows - the maximum number of rows returned
      scrollable - if the result set must be scrollable
      Returns:
      the result
    • executeUpdate

      public ResultWithGeneratedKeys executeUpdate(Object generatedKeysRequest)
      Description copied from interface: CommandInterface
      Execute the statement
      Specified by:
      executeUpdate in interface CommandInterface
      Parameters:
      generatedKeysRequest - null or false if generated keys are not needed, true if generated keys should be configured automatically, int[] to specify column indices to return generated keys from, or String[] to specify column names to return generated keys from
      Returns:
      the update count and generated keys, if any
    • checkParameters

      private void checkParameters()
    • sendParameters

      private void sendParameters(Transfer transfer) throws IOException
      Throws:
      IOException
    • close

      public void close()
      Description copied from interface: CommandInterface
      Close the statement.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface CommandInterface
    • cancel

      public void cancel()
      Cancel this current statement.
      Specified by:
      cancel in interface CommandInterface
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getCommandType

      public int getCommandType()
      Description copied from interface: CommandInterface
      Get command type.
      Specified by:
      getCommandType in interface CommandInterface
      Returns:
      one of the constants above