Interface CommandInterface

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
Command, CommandContainer, CommandList, CommandRemote

public interface CommandInterface extends AutoCloseable
Represents a SQL statement.
  • Field Details

    • UNKNOWN

      static final int UNKNOWN
      The type for unknown statement.
      See Also:
    • ALTER_INDEX_RENAME

      static final int ALTER_INDEX_RENAME
      The type of a ALTER INDEX RENAME statement.
      See Also:
    • ALTER_SCHEMA_RENAME

      static final int ALTER_SCHEMA_RENAME
      The type of an ALTER SCHEMA RENAME statement.
      See Also:
    • ALTER_TABLE_ADD_CONSTRAINT_CHECK

      static final int ALTER_TABLE_ADD_CONSTRAINT_CHECK
      The type of an ALTER TABLE ADD CHECK statement.
      See Also:
    • ALTER_TABLE_ADD_CONSTRAINT_UNIQUE

      static final int ALTER_TABLE_ADD_CONSTRAINT_UNIQUE
      The type of an ALTER TABLE ADD UNIQUE statement.
      See Also:
    • ALTER_TABLE_ADD_CONSTRAINT_REFERENTIAL

      static final int ALTER_TABLE_ADD_CONSTRAINT_REFERENTIAL
      The type of an ALTER TABLE ADD FOREIGN KEY statement.
      See Also:
    • ALTER_TABLE_ADD_CONSTRAINT_PRIMARY_KEY

      static final int ALTER_TABLE_ADD_CONSTRAINT_PRIMARY_KEY
      The type of an ALTER TABLE ADD PRIMARY KEY statement.
      See Also:
    • ALTER_TABLE_ADD_COLUMN

      static final int ALTER_TABLE_ADD_COLUMN
      The type of an ALTER TABLE ADD statement.
      See Also:
    • ALTER_TABLE_ALTER_COLUMN_NOT_NULL

      static final int ALTER_TABLE_ALTER_COLUMN_NOT_NULL
      The type of an ALTER TABLE ALTER COLUMN SET NOT NULL statement.
      See Also:
    • ALTER_TABLE_ALTER_COLUMN_DROP_NOT_NULL

      static final int ALTER_TABLE_ALTER_COLUMN_DROP_NOT_NULL
      The type of an ALTER TABLE ALTER COLUMN DROP NOT NULL statement.
      See Also:
    • ALTER_TABLE_ALTER_COLUMN_DEFAULT

      static final int ALTER_TABLE_ALTER_COLUMN_DEFAULT
      The type of an ALTER TABLE ALTER COLUMN SET DEFAULT and ALTER TABLE ALTER COLUMN DROP DEFAULT statements.
      See Also:
    • ALTER_TABLE_ALTER_COLUMN_CHANGE_TYPE

      static final int ALTER_TABLE_ALTER_COLUMN_CHANGE_TYPE
      The type of an ALTER TABLE ALTER COLUMN statement that changes the column data type.
      See Also:
    • ALTER_TABLE_DROP_COLUMN

      static final int ALTER_TABLE_DROP_COLUMN
      The type of an ALTER TABLE DROP COLUMN statement.
      See Also:
    • ALTER_TABLE_ALTER_COLUMN_SELECTIVITY

      static final int ALTER_TABLE_ALTER_COLUMN_SELECTIVITY
      The type of an ALTER TABLE ALTER COLUMN SELECTIVITY statement.
      See Also:
    • ALTER_TABLE_DROP_CONSTRAINT

      static final int ALTER_TABLE_DROP_CONSTRAINT
      The type of an ALTER TABLE DROP CONSTRAINT statement.
      See Also:
    • ALTER_TABLE_RENAME

      static final int ALTER_TABLE_RENAME
      The type of an ALTER TABLE RENAME statement.
      See Also:
    • ALTER_TABLE_ALTER_COLUMN_RENAME

      static final int ALTER_TABLE_ALTER_COLUMN_RENAME
      The type of an ALTER TABLE ALTER COLUMN RENAME statement.
      See Also:
    • ALTER_USER_ADMIN

      static final int ALTER_USER_ADMIN
      The type of an ALTER USER ADMIN statement.
      See Also:
    • ALTER_USER_RENAME

      static final int ALTER_USER_RENAME
      The type of an ALTER USER RENAME statement.
      See Also:
    • ALTER_USER_SET_PASSWORD

      static final int ALTER_USER_SET_PASSWORD
      The type of an ALTER USER SET PASSWORD statement.
      See Also:
    • ALTER_VIEW

      static final int ALTER_VIEW
      The type of an ALTER VIEW statement.
      See Also:
    • ANALYZE

      static final int ANALYZE
      The type of an ANALYZE statement.
      See Also:
    • CREATE_AGGREGATE

      static final int CREATE_AGGREGATE
      The type of a CREATE AGGREGATE statement.
      See Also:
    • CREATE_CONSTANT

      static final int CREATE_CONSTANT
      The type of a CREATE CONSTANT statement.
      See Also:
    • CREATE_ALIAS

      static final int CREATE_ALIAS
      The type of a CREATE ALIAS statement.
      See Also:
    • CREATE_INDEX

      static final int CREATE_INDEX
      The type of a CREATE INDEX statement.
      See Also:
    • CREATE_LINKED_TABLE

      static final int CREATE_LINKED_TABLE
      The type of a CREATE LINKED TABLE statement.
      See Also:
    • CREATE_ROLE

      static final int CREATE_ROLE
      The type of a CREATE ROLE statement.
      See Also:
    • CREATE_SCHEMA

      static final int CREATE_SCHEMA
      The type of a CREATE SCHEMA statement.
      See Also:
    • CREATE_SEQUENCE

      static final int CREATE_SEQUENCE
      The type of a CREATE SEQUENCE statement.
      See Also:
    • CREATE_TABLE

      static final int CREATE_TABLE
      The type of a CREATE TABLE statement.
      See Also:
    • CREATE_TRIGGER

      static final int CREATE_TRIGGER
      The type of a CREATE TRIGGER statement.
      See Also:
    • CREATE_USER

      static final int CREATE_USER
      The type of a CREATE USER statement.
      See Also:
    • CREATE_DOMAIN

      static final int CREATE_DOMAIN
      The type of a CREATE DOMAIN statement.
      See Also:
    • CREATE_VIEW

      static final int CREATE_VIEW
      The type of a CREATE VIEW statement.
      See Also:
    • DEALLOCATE

      static final int DEALLOCATE
      The type of a DEALLOCATE statement.
      See Also:
    • DROP_AGGREGATE

      static final int DROP_AGGREGATE
      The type of a DROP AGGREGATE statement.
      See Also:
    • DROP_CONSTANT

      static final int DROP_CONSTANT
      The type of a DROP CONSTANT statement.
      See Also:
    • DROP_ALL_OBJECTS

      static final int DROP_ALL_OBJECTS
      The type of a DROP ALL OBJECTS statement.
      See Also:
    • DROP_ALIAS

      static final int DROP_ALIAS
      The type of a DROP ALIAS statement.
      See Also:
    • DROP_INDEX

      static final int DROP_INDEX
      The type of a DROP INDEX statement.
      See Also:
    • DROP_ROLE

      static final int DROP_ROLE
      The type of a DROP ROLE statement.
      See Also:
    • DROP_SCHEMA

      static final int DROP_SCHEMA
      The type of a DROP SCHEMA statement.
      See Also:
    • DROP_SEQUENCE

      static final int DROP_SEQUENCE
      The type of a DROP SEQUENCE statement.
      See Also:
    • DROP_TABLE

      static final int DROP_TABLE
      The type of a DROP TABLE statement.
      See Also:
    • DROP_TRIGGER

      static final int DROP_TRIGGER
      The type of a DROP TRIGGER statement.
      See Also:
    • DROP_USER

      static final int DROP_USER
      The type of a DROP USER statement.
      See Also:
    • DROP_DOMAIN

      static final int DROP_DOMAIN
      The type of a DROP DOMAIN statement.
      See Also:
    • DROP_VIEW

      static final int DROP_VIEW
      The type of a DROP VIEW statement.
      See Also:
    • GRANT

      static final int GRANT
      The type of a GRANT statement.
      See Also:
    • REVOKE

      static final int REVOKE
      The type of a REVOKE statement.
      See Also:
    • PREPARE

      static final int PREPARE
      The type of a PREPARE statement.
      See Also:
    • COMMENT

      static final int COMMENT
      The type of a COMMENT statement.
      See Also:
    • TRUNCATE_TABLE

      static final int TRUNCATE_TABLE
      The type of a TRUNCATE TABLE statement.
      See Also:
    • ALTER_SEQUENCE

      static final int ALTER_SEQUENCE
      The type of an ALTER SEQUENCE statement.
      See Also:
    • ALTER_TABLE_SET_REFERENTIAL_INTEGRITY

      static final int ALTER_TABLE_SET_REFERENTIAL_INTEGRITY
      The type of an ALTER TABLE SET REFERENTIAL_INTEGRITY statement.
      See Also:
    • BACKUP

      static final int BACKUP
      The type of a BACKUP statement.
      See Also:
    • CALL

      static final int CALL
      The type of a CALL statement.
      See Also:
    • DELETE

      static final int DELETE
      The type of a DELETE statement.
      See Also:
    • EXECUTE

      static final int EXECUTE
      The type of an EXECUTE statement.
      See Also:
    • EXPLAIN

      static final int EXPLAIN
      The type of an EXPLAIN statement.
      See Also:
    • INSERT

      static final int INSERT
      The type of an INSERT statement.
      See Also:
    • MERGE

      static final int MERGE
      The type of a MERGE statement.
      See Also:
    • REPLACE

      static final int REPLACE
      The type of a REPLACE statement.
      See Also:
    • NO_OPERATION

      static final int NO_OPERATION
      The type of a no operation statement.
      See Also:
    • RUNSCRIPT

      static final int RUNSCRIPT
      The type of a RUNSCRIPT statement.
      See Also:
    • SCRIPT

      static final int SCRIPT
      The type of a SCRIPT statement.
      See Also:
    • SELECT

      static final int SELECT
      The type of a SELECT statement.
      See Also:
    • SET

      static final int SET
      The type of a SET statement.
      See Also:
    • UPDATE

      static final int UPDATE
      The type of an UPDATE statement.
      See Also:
    • SET_AUTOCOMMIT_TRUE

      static final int SET_AUTOCOMMIT_TRUE
      The type of a SET AUTOCOMMIT statement.
      See Also:
    • SET_AUTOCOMMIT_FALSE

      static final int SET_AUTOCOMMIT_FALSE
      The type of a SET AUTOCOMMIT statement.
      See Also:
    • COMMIT

      static final int COMMIT
      The type of a COMMIT statement.
      See Also:
    • ROLLBACK

      static final int ROLLBACK
      The type of a ROLLBACK statement.
      See Also:
    • CHECKPOINT

      static final int CHECKPOINT
      The type of a CHECKPOINT statement.
      See Also:
    • SAVEPOINT

      static final int SAVEPOINT
      The type of a SAVEPOINT statement.
      See Also:
    • ROLLBACK_TO_SAVEPOINT

      static final int ROLLBACK_TO_SAVEPOINT
      The type of a ROLLBACK TO SAVEPOINT statement.
      See Also:
    • CHECKPOINT_SYNC

      static final int CHECKPOINT_SYNC
      The type of a CHECKPOINT SYNC statement.
      See Also:
    • PREPARE_COMMIT

      static final int PREPARE_COMMIT
      The type of a PREPARE COMMIT statement.
      See Also:
    • COMMIT_TRANSACTION

      static final int COMMIT_TRANSACTION
      The type of a COMMIT TRANSACTION statement.
      See Also:
    • ROLLBACK_TRANSACTION

      static final int ROLLBACK_TRANSACTION
      The type of a ROLLBACK TRANSACTION statement.
      See Also:
    • SHUTDOWN

      static final int SHUTDOWN
      The type of a SHUTDOWN statement.
      See Also:
    • SHUTDOWN_IMMEDIATELY

      static final int SHUTDOWN_IMMEDIATELY
      The type of a SHUTDOWN IMMEDIATELY statement.
      See Also:
    • SHUTDOWN_COMPACT

      static final int SHUTDOWN_COMPACT
      The type of a SHUTDOWN COMPACT statement.
      See Also:
    • BEGIN

      static final int BEGIN
      The type of a BEGIN {WORK|TRANSACTION} statement.
      See Also:
    • SHUTDOWN_DEFRAG

      static final int SHUTDOWN_DEFRAG
      The type of a SHUTDOWN DEFRAG statement.
      See Also:
    • ALTER_TABLE_RENAME_CONSTRAINT

      static final int ALTER_TABLE_RENAME_CONSTRAINT
      The type of an ALTER TABLE RENAME CONSTRAINT statement.
      See Also:
    • EXPLAIN_ANALYZE

      static final int EXPLAIN_ANALYZE
      The type of an EXPLAIN ANALYZE statement.
      See Also:
    • ALTER_TABLE_ALTER_COLUMN_VISIBILITY

      static final int ALTER_TABLE_ALTER_COLUMN_VISIBILITY
      The type of an ALTER TABLE ALTER COLUMN SET INVISIBLE statement.
      See Also:
    • CREATE_SYNONYM

      static final int CREATE_SYNONYM
      The type of a CREATE SYNONYM statement.
      See Also:
    • DROP_SYNONYM

      static final int DROP_SYNONYM
      The type of a DROP SYNONYM statement.
      See Also:
    • ALTER_TABLE_ALTER_COLUMN_ON_UPDATE

      static final int ALTER_TABLE_ALTER_COLUMN_ON_UPDATE
      The type of an ALTER TABLE ALTER COLUMN SET ON UPDATE statement.
      See Also:
    • EXECUTE_IMMEDIATELY

      static final int EXECUTE_IMMEDIATELY
      The type of an EXECUTE IMMEDIATELY statement.
      See Also:
    • ALTER_DOMAIN_ADD_CONSTRAINT

      static final int ALTER_DOMAIN_ADD_CONSTRAINT
      The type of ALTER DOMAIN ADD CONSTRAINT statement.
      See Also:
    • ALTER_DOMAIN_DROP_CONSTRAINT

      static final int ALTER_DOMAIN_DROP_CONSTRAINT
      The type of ALTER DOMAIN DROP CONSTRAINT statement.
      See Also:
    • ALTER_DOMAIN_DEFAULT

      static final int ALTER_DOMAIN_DEFAULT
      The type of an ALTER DOMAIN SET DEFAULT and ALTER DOMAIN DROP DEFAULT statements.
      See Also:
    • ALTER_DOMAIN_ON_UPDATE

      static final int ALTER_DOMAIN_ON_UPDATE
      The type of an ALTER DOMAIN SET ON UPDATE and ALTER DOMAIN DROP ON UPDATE statements.
      See Also:
    • ALTER_DOMAIN_RENAME

      static final int ALTER_DOMAIN_RENAME
      The type of an ALTER DOMAIN RENAME statement.
      See Also:
    • HELP

      static final int HELP
      The type of a HELP statement.
      See Also:
    • ALTER_TABLE_ALTER_COLUMN_DROP_EXPRESSION

      static final int ALTER_TABLE_ALTER_COLUMN_DROP_EXPRESSION
      The type of an ALTER TABLE ALTER COLUMN DROP EXPRESSION statement.
      See Also:
    • ALTER_TABLE_ALTER_COLUMN_DROP_IDENTITY

      static final int ALTER_TABLE_ALTER_COLUMN_DROP_IDENTITY
      The type of an ALTER TABLE ALTER COLUMN DROP IDENTITY statement.
      See Also:
    • ALTER_TABLE_ALTER_COLUMN_DEFAULT_ON_NULL

      static final int ALTER_TABLE_ALTER_COLUMN_DEFAULT_ON_NULL
      The type of ALTER TABLE ALTER COLUMN SET DEFAULT ON NULL and ALTER TABLE ALTER COLUMN DROP DEFAULT ON NULL statements.
      See Also:
    • ALTER_DOMAIN_RENAME_CONSTRAINT

      static final int ALTER_DOMAIN_RENAME_CONSTRAINT
      The type of an ALTER DOMAIN RENAME CONSTRAINT statement.
      See Also:
  • Method Details

    • getCommandType

      int getCommandType()
      Get command type.
      Returns:
      one of the constants above
    • isQuery

      boolean isQuery()
      Check if this is a query.
      Returns:
      true if it is a query
    • getParameters

      ArrayList<? extends ParameterInterface> getParameters()
      Get the parameters (if any).
      Returns:
      the parameters
    • executeQuery

      ResultInterface executeQuery(long maxRows, boolean scrollable)
      Execute the query.
      Parameters:
      maxRows - the maximum number of rows returned
      scrollable - if the result set must be scrollable
      Returns:
      the result
    • executeUpdate

      ResultWithGeneratedKeys executeUpdate(Object generatedKeysRequest)
      Execute the statement
      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
    • stop

      void stop()
      Stop the command execution, release all locks and resources
    • close

      void close()
      Close the statement.
      Specified by:
      close in interface AutoCloseable
    • cancel

      void cancel()
      Cancel the statement if it is still processing.
    • getMetaData

      ResultInterface getMetaData()
      Get an empty result set containing the meta data of the result.
      Returns:
      the empty result