Package org.h2.command
Interface CommandInterface
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
Command,CommandContainer,CommandRemote
Represents a SQL statement.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe type of ALTER DOMAIN ADD CONSTRAINT statement.static final intThe type of ALTER DOMAIN SET DEFAULT and ALTER DOMAIN DROP DEFAULT statements.static final intThe type of ALTER DOMAIN DROP CONSTRAINT statement.static final intThe type of ALTER DOMAIN SET ON UPDATE and ALTER DOMAIN DROP ON UPDATE statements.static final intThe type of ALTER DOMAIN RENAME statement.static final intThe type of ALTER DOMAIN RENAME CONSTRAINT statement.static final intThe type of ALTER INDEX RENAME statement.static final intThe type of ALTER SCHEMA RENAME statement.static final intThe type of ALTER SEQUENCE statement.static final intThe type of ALTER TABLE ADD statement.static final intThe type of ALTER TABLE ADD CHECK statement.static final intThe type of ALTER TABLE ADD PRIMARY KEY statement.static final intThe type of ALTER TABLE ADD FOREIGN KEY statement.static final intThe type of ALTER TABLE ADD UNIQUE statement.static final intThe type of ALTER TABLE ALTER COLUMN statement that changes the column data type.static final intThe type of ALTER TABLE ALTER COLUMN SET DEFAULT and ALTER TABLE ALTER COLUMN DROP DEFAULT statements.static final intThe type of ALTER TABLE ALTER COLUMN SET DEFAULT ON NULL and ALTER TABLE ALTER COLUMN DROP DEFAULT ON NULL statements.static final intThe type of ALTER TABLE ALTER COLUMN DROP EXPRESSION statement.static final intThe type of ALTER TABLE ALTER COLUMN DROP IDENTITY statement.static final intThe type of ALTER TABLE ALTER COLUMN DROP NOT NULL statement.static final intThe type of ALTER TABLE ALTER COLUMN SET NOT NULL statement.static final intThe type of ALTER TABLE ALTER COLUMN SET ON UPDATE statement.static final intThe type of ALTER TABLE ALTER COLUMN RENAME statement.static final intThe type of ALTER TABLE ALTER COLUMN SELECTIVITY statement.static final intThe type of ALTER TABLE ALTER COLUMN SET INVISIBLE statement.static final intThe type of ALTER TABLE DROP COLUMN statement.static final intThe type of ALTER TABLE DROP CONSTRAINT statement.static final intThe type of ALTER TABLE RENAME statement.static final intThe type of ALTER TABLE RENAME CONSTRAINT statement.static final intThe type of ALTER TABLE SET REFERENTIAL_INTEGRITY statement.static final intThe type of ALTER TYPE statement.static final intThe type of ALTER USER ADMIN statement.static final intThe type of ALTER USER RENAME statement.static final intThe type of ALTER USER SET PASSWORD statement.static final intThe type of ALTER VIEW statement.static final intThe type of ANALYZE statement.static final intThe type of BACKUP statement.static final intThe type of BEGIN {WORK|TRANSACTION} statement.static final intThe type of CALL statement.static final intThe type of CHECKPOINT statement.static final intThe type of CHECKPOINT SYNC statement.static final intThe type of COMMENT statement.static final intThe type of COMMIT statement.static final intThe type of COMMIT TRANSACTION statement.static final intThe type of CREATE AGGREGATE statement.static final intThe type of CREATE ALIAS statement.static final intThe type of CREATE CONSTANT statement.static final intThe type of CREATE DOMAIN statement.static final intThe type of CREATE INDEX statement.static final intThe type of CREATE LINKED TABLE statement.static final intThe type of CREATE MATERIALIZED VIEW statement.static final intThe type of CREATE ROLE statement.static final intThe type of CREATE SCHEMA statement.static final intThe type of CREATE SEQUENCE statement.static final intThe type of CREATE SYNONYM statement.static final intThe type of CREATE TABLE statement.static final intThe type of CREATE TRIGGER statement.static final intThe type of CREATE USER statement.static final intThe type of CREATE VIEW statement.static final intThe type of DEALLOCATE statement.static final intThe type of DELETE statement.static final intThe type of DROP AGGREGATE statement.static final intThe type of DROP ALIAS statement.static final intThe type of DROP ALL OBJECTS statement.static final intThe type of DROP CONSTANT statement.static final intThe type of DROP DOMAIN statement.static final intThe type of DROP INDEX statement.static final intThe type of DROP MATERIALIZED VIEW statement.static final intThe type of DROP ROLE statement.static final intThe type of DROP SCHEMA statement.static final intThe type of DROP SEQUENCE statement.static final intThe type of DROP SYNONYM statement.static final intThe type of DROP TABLE statement.static final intThe type of DROP TRIGGER statement.static final intThe type of DROP USER statement.static final intThe type of DROP VIEW statement.static final intThe type of EXECUTE statement.static final intThe type of EXECUTE IMMEDIATELY statement.static final intThe type of EXPLAIN statement.static final intThe type of EXPLAIN ANALYZE statement.static final intThe type of GRANT statement.static final intThe type of HELP statement.static final intThe type of INSERT statement.static final intThe type of MERGE statement.static final intThe type of no operation statement.static final intThe type of PREPARE statement.static final intThe type of PREPARE COMMIT statement.static final intThe type of REFRESH MATERIALIZED VIEW statement.static final intThe type of REPLACE statement.static final intThe type of REVOKE statement.static final intThe type of ROLLBACK statement.static final intThe type of ROLLBACK TO SAVEPOINT statement.static final intThe type of ROLLBACK TRANSACTION statement.static final intThe type of RUNSCRIPT statement.static final intThe type of SAVEPOINT statement.static final intThe type of SCRIPT statement.static final intThe type of SELECT statement.static final intThe type of SET statement.static final intThe type of SET AUTOCOMMIT statement.static final intThe type of SET AUTOCOMMIT statement.static final intThe type of SHUTDOWN statement.static final intThe type of SHUTDOWN COMPACT statement.static final intThe type of SHUTDOWN DEFRAG statement.static final intThe type of SHUTDOWN IMMEDIATELY statement.static final intThe type of TRUNCATE TABLE statement.static final intThe type for unknown statement.static final intThe type of UPDATE statement. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancel the statement if it is still processing.voidclose()Close the statement.executeBatchUpdate(ArrayList<Value[]> batchParameters, Object generatedKeysRequest) Executes the statement with multiple sets of parameters.executeQuery(long maxRows, int fetchSize, boolean scrollable) Execute the query.executeUpdate(Object generatedKeysRequest) Execute the statementintGet command type.Get an empty result set containing the meta data of the result.ArrayList<? extends ParameterInterface> Get the parameters (if any).booleanisQuery()Check if this is a query.voidstop(boolean commitIfAutoCommit) Stop the command execution, release all locks and resources.
-
Field Details
-
UNKNOWN
static final int UNKNOWNThe type for unknown statement.- See Also:
-
ALTER_INDEX_RENAME
static final int ALTER_INDEX_RENAMEThe type of ALTER INDEX RENAME statement.- See Also:
-
ALTER_SCHEMA_RENAME
static final int ALTER_SCHEMA_RENAMEThe type of ALTER SCHEMA RENAME statement.- See Also:
-
ALTER_TABLE_ADD_CONSTRAINT_CHECK
static final int ALTER_TABLE_ADD_CONSTRAINT_CHECKThe type of ALTER TABLE ADD CHECK statement.- See Also:
-
ALTER_TABLE_ADD_CONSTRAINT_UNIQUE
static final int ALTER_TABLE_ADD_CONSTRAINT_UNIQUEThe type of ALTER TABLE ADD UNIQUE statement.- See Also:
-
ALTER_TABLE_ADD_CONSTRAINT_REFERENTIAL
static final int ALTER_TABLE_ADD_CONSTRAINT_REFERENTIALThe type of ALTER TABLE ADD FOREIGN KEY statement.- See Also:
-
ALTER_TABLE_ADD_CONSTRAINT_PRIMARY_KEY
static final int ALTER_TABLE_ADD_CONSTRAINT_PRIMARY_KEYThe type of ALTER TABLE ADD PRIMARY KEY statement.- See Also:
-
ALTER_TABLE_ADD_COLUMN
static final int ALTER_TABLE_ADD_COLUMNThe type of ALTER TABLE ADD statement.- See Also:
-
ALTER_TABLE_ALTER_COLUMN_NOT_NULL
static final int ALTER_TABLE_ALTER_COLUMN_NOT_NULLThe type of 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_NULLThe type of ALTER TABLE ALTER COLUMN DROP NOT NULL statement.- See Also:
-
ALTER_TABLE_ALTER_COLUMN_DEFAULT
static final int ALTER_TABLE_ALTER_COLUMN_DEFAULTThe type of 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_TYPEThe type of ALTER TABLE ALTER COLUMN statement that changes the column data type.- See Also:
-
ALTER_TABLE_DROP_COLUMN
static final int ALTER_TABLE_DROP_COLUMNThe type of ALTER TABLE DROP COLUMN statement.- See Also:
-
ALTER_TABLE_ALTER_COLUMN_SELECTIVITY
static final int ALTER_TABLE_ALTER_COLUMN_SELECTIVITYThe type of ALTER TABLE ALTER COLUMN SELECTIVITY statement.- See Also:
-
ALTER_TABLE_DROP_CONSTRAINT
static final int ALTER_TABLE_DROP_CONSTRAINTThe type of ALTER TABLE DROP CONSTRAINT statement.- See Also:
-
ALTER_TABLE_RENAME
static final int ALTER_TABLE_RENAMEThe type of ALTER TABLE RENAME statement.- See Also:
-
ALTER_TABLE_ALTER_COLUMN_RENAME
static final int ALTER_TABLE_ALTER_COLUMN_RENAMEThe type of ALTER TABLE ALTER COLUMN RENAME statement.- See Also:
-
ALTER_USER_ADMIN
static final int ALTER_USER_ADMINThe type of ALTER USER ADMIN statement.- See Also:
-
ALTER_USER_RENAME
static final int ALTER_USER_RENAMEThe type of ALTER USER RENAME statement.- See Also:
-
ALTER_USER_SET_PASSWORD
static final int ALTER_USER_SET_PASSWORDThe type of ALTER USER SET PASSWORD statement.- See Also:
-
ALTER_VIEW
static final int ALTER_VIEWThe type of ALTER VIEW statement.- See Also:
-
ANALYZE
static final int ANALYZEThe type of ANALYZE statement.- See Also:
-
CREATE_AGGREGATE
static final int CREATE_AGGREGATEThe type of CREATE AGGREGATE statement.- See Also:
-
CREATE_CONSTANT
static final int CREATE_CONSTANTThe type of CREATE CONSTANT statement.- See Also:
-
CREATE_ALIAS
static final int CREATE_ALIASThe type of CREATE ALIAS statement.- See Also:
-
CREATE_INDEX
static final int CREATE_INDEXThe type of CREATE INDEX statement.- See Also:
-
CREATE_LINKED_TABLE
static final int CREATE_LINKED_TABLEThe type of CREATE LINKED TABLE statement.- See Also:
-
CREATE_ROLE
static final int CREATE_ROLEThe type of CREATE ROLE statement.- See Also:
-
CREATE_SCHEMA
static final int CREATE_SCHEMAThe type of CREATE SCHEMA statement.- See Also:
-
CREATE_SEQUENCE
static final int CREATE_SEQUENCEThe type of CREATE SEQUENCE statement.- See Also:
-
CREATE_TABLE
static final int CREATE_TABLEThe type of CREATE TABLE statement.- See Also:
-
CREATE_TRIGGER
static final int CREATE_TRIGGERThe type of CREATE TRIGGER statement.- See Also:
-
CREATE_USER
static final int CREATE_USERThe type of CREATE USER statement.- See Also:
-
CREATE_DOMAIN
static final int CREATE_DOMAINThe type of CREATE DOMAIN statement.- See Also:
-
CREATE_VIEW
static final int CREATE_VIEWThe type of CREATE VIEW statement.- See Also:
-
DEALLOCATE
static final int DEALLOCATEThe type of DEALLOCATE statement.- See Also:
-
DROP_AGGREGATE
static final int DROP_AGGREGATEThe type of DROP AGGREGATE statement.- See Also:
-
DROP_CONSTANT
static final int DROP_CONSTANTThe type of DROP CONSTANT statement.- See Also:
-
DROP_ALL_OBJECTS
static final int DROP_ALL_OBJECTSThe type of DROP ALL OBJECTS statement.- See Also:
-
DROP_ALIAS
static final int DROP_ALIASThe type of DROP ALIAS statement.- See Also:
-
DROP_INDEX
static final int DROP_INDEXThe type of DROP INDEX statement.- See Also:
-
DROP_ROLE
static final int DROP_ROLEThe type of DROP ROLE statement.- See Also:
-
DROP_SCHEMA
static final int DROP_SCHEMAThe type of DROP SCHEMA statement.- See Also:
-
DROP_SEQUENCE
static final int DROP_SEQUENCEThe type of DROP SEQUENCE statement.- See Also:
-
DROP_TABLE
static final int DROP_TABLEThe type of DROP TABLE statement.- See Also:
-
DROP_TRIGGER
static final int DROP_TRIGGERThe type of DROP TRIGGER statement.- See Also:
-
DROP_USER
static final int DROP_USERThe type of DROP USER statement.- See Also:
-
DROP_DOMAIN
static final int DROP_DOMAINThe type of DROP DOMAIN statement.- See Also:
-
DROP_VIEW
static final int DROP_VIEWThe type of DROP VIEW statement.- See Also:
-
GRANT
static final int GRANTThe type of GRANT statement.- See Also:
-
REVOKE
static final int REVOKEThe type of REVOKE statement.- See Also:
-
PREPARE
static final int PREPAREThe type of PREPARE statement.- See Also:
-
COMMENT
static final int COMMENTThe type of COMMENT statement.- See Also:
-
TRUNCATE_TABLE
static final int TRUNCATE_TABLEThe type of TRUNCATE TABLE statement.- See Also:
-
ALTER_SEQUENCE
static final int ALTER_SEQUENCEThe type of ALTER SEQUENCE statement.- See Also:
-
ALTER_TABLE_SET_REFERENTIAL_INTEGRITY
static final int ALTER_TABLE_SET_REFERENTIAL_INTEGRITYThe type of ALTER TABLE SET REFERENTIAL_INTEGRITY statement.- See Also:
-
BACKUP
static final int BACKUPThe type of BACKUP statement.- See Also:
-
CALL
static final int CALLThe type of CALL statement.- See Also:
-
DELETE
static final int DELETEThe type of DELETE statement.- See Also:
-
EXECUTE
static final int EXECUTEThe type of EXECUTE statement.- See Also:
-
EXPLAIN
static final int EXPLAINThe type of EXPLAIN statement.- See Also:
-
INSERT
static final int INSERTThe type of INSERT statement.- See Also:
-
MERGE
static final int MERGEThe type of MERGE statement.- See Also:
-
REPLACE
static final int REPLACEThe type of REPLACE statement.- See Also:
-
NO_OPERATION
static final int NO_OPERATIONThe type of no operation statement.- See Also:
-
RUNSCRIPT
static final int RUNSCRIPTThe type of RUNSCRIPT statement.- See Also:
-
SCRIPT
static final int SCRIPTThe type of SCRIPT statement.- See Also:
-
SELECT
static final int SELECTThe type of SELECT statement.- See Also:
-
SET
static final int SETThe type of SET statement.- See Also:
-
UPDATE
static final int UPDATEThe type of UPDATE statement.- See Also:
-
SET_AUTOCOMMIT_TRUE
static final int SET_AUTOCOMMIT_TRUEThe type of SET AUTOCOMMIT statement.- See Also:
-
SET_AUTOCOMMIT_FALSE
static final int SET_AUTOCOMMIT_FALSEThe type of SET AUTOCOMMIT statement.- See Also:
-
COMMIT
static final int COMMITThe type of COMMIT statement.- See Also:
-
ROLLBACK
static final int ROLLBACKThe type of ROLLBACK statement.- See Also:
-
CHECKPOINT
static final int CHECKPOINTThe type of CHECKPOINT statement.- See Also:
-
SAVEPOINT
static final int SAVEPOINTThe type of SAVEPOINT statement.- See Also:
-
ROLLBACK_TO_SAVEPOINT
static final int ROLLBACK_TO_SAVEPOINTThe type of ROLLBACK TO SAVEPOINT statement.- See Also:
-
CHECKPOINT_SYNC
static final int CHECKPOINT_SYNCThe type of CHECKPOINT SYNC statement.- See Also:
-
PREPARE_COMMIT
static final int PREPARE_COMMITThe type of PREPARE COMMIT statement.- See Also:
-
COMMIT_TRANSACTION
static final int COMMIT_TRANSACTIONThe type of COMMIT TRANSACTION statement.- See Also:
-
ROLLBACK_TRANSACTION
static final int ROLLBACK_TRANSACTIONThe type of ROLLBACK TRANSACTION statement.- See Also:
-
SHUTDOWN
static final int SHUTDOWNThe type of SHUTDOWN statement.- See Also:
-
SHUTDOWN_IMMEDIATELY
static final int SHUTDOWN_IMMEDIATELYThe type of SHUTDOWN IMMEDIATELY statement.- See Also:
-
SHUTDOWN_COMPACT
static final int SHUTDOWN_COMPACTThe type of SHUTDOWN COMPACT statement.- See Also:
-
BEGIN
static final int BEGINThe type of BEGIN {WORK|TRANSACTION} statement.- See Also:
-
SHUTDOWN_DEFRAG
static final int SHUTDOWN_DEFRAGThe type of SHUTDOWN DEFRAG statement.- See Also:
-
ALTER_TABLE_RENAME_CONSTRAINT
static final int ALTER_TABLE_RENAME_CONSTRAINTThe type of ALTER TABLE RENAME CONSTRAINT statement.- See Also:
-
EXPLAIN_ANALYZE
static final int EXPLAIN_ANALYZEThe type of EXPLAIN ANALYZE statement.- See Also:
-
ALTER_TABLE_ALTER_COLUMN_VISIBILITY
static final int ALTER_TABLE_ALTER_COLUMN_VISIBILITYThe type of ALTER TABLE ALTER COLUMN SET INVISIBLE statement.- See Also:
-
CREATE_SYNONYM
static final int CREATE_SYNONYMThe type of CREATE SYNONYM statement.- See Also:
-
DROP_SYNONYM
static final int DROP_SYNONYMThe type of DROP SYNONYM statement.- See Also:
-
ALTER_TABLE_ALTER_COLUMN_ON_UPDATE
static final int ALTER_TABLE_ALTER_COLUMN_ON_UPDATEThe type of ALTER TABLE ALTER COLUMN SET ON UPDATE statement.- See Also:
-
EXECUTE_IMMEDIATELY
static final int EXECUTE_IMMEDIATELYThe type of EXECUTE IMMEDIATELY statement.- See Also:
-
ALTER_DOMAIN_ADD_CONSTRAINT
static final int ALTER_DOMAIN_ADD_CONSTRAINTThe type of ALTER DOMAIN ADD CONSTRAINT statement.- See Also:
-
ALTER_DOMAIN_DROP_CONSTRAINT
static final int ALTER_DOMAIN_DROP_CONSTRAINTThe type of ALTER DOMAIN DROP CONSTRAINT statement.- See Also:
-
ALTER_DOMAIN_DEFAULT
static final int ALTER_DOMAIN_DEFAULTThe type of ALTER DOMAIN SET DEFAULT and ALTER DOMAIN DROP DEFAULT statements.- See Also:
-
ALTER_DOMAIN_ON_UPDATE
static final int ALTER_DOMAIN_ON_UPDATEThe type of ALTER DOMAIN SET ON UPDATE and ALTER DOMAIN DROP ON UPDATE statements.- See Also:
-
ALTER_DOMAIN_RENAME
static final int ALTER_DOMAIN_RENAMEThe type of ALTER DOMAIN RENAME statement.- See Also:
-
HELP
static final int HELPThe type of HELP statement.- See Also:
-
ALTER_TABLE_ALTER_COLUMN_DROP_EXPRESSION
static final int ALTER_TABLE_ALTER_COLUMN_DROP_EXPRESSIONThe type of ALTER TABLE ALTER COLUMN DROP EXPRESSION statement.- See Also:
-
ALTER_TABLE_ALTER_COLUMN_DROP_IDENTITY
static final int ALTER_TABLE_ALTER_COLUMN_DROP_IDENTITYThe type of 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_NULLThe 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_CONSTRAINTThe type of ALTER DOMAIN RENAME CONSTRAINT statement.- See Also:
-
CREATE_MATERIALIZED_VIEW
static final int CREATE_MATERIALIZED_VIEWThe type of CREATE MATERIALIZED VIEW statement.- See Also:
-
REFRESH_MATERIALIZED_VIEW
static final int REFRESH_MATERIALIZED_VIEWThe type of REFRESH MATERIALIZED VIEW statement.- See Also:
-
DROP_MATERIALIZED_VIEW
static final int DROP_MATERIALIZED_VIEWThe type of DROP MATERIALIZED VIEW statement.- See Also:
-
ALTER_TYPE
static final int ALTER_TYPEThe type of ALTER TYPE 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
Execute the query.- Parameters:
maxRows- the maximum number of rows returnedfetchSize- the number of rows to fetch (for remote commands only)scrollable- if the result set must be scrollable- Returns:
- the result
-
executeUpdate
Execute the statement- Parameters:
generatedKeysRequest-nullorfalseif generated keys are not needed,trueif generated keys should be configured automatically,int[]to specify column indices to return generated keys from, orString[]to specify column names to return generated keys from- Returns:
- the update count and generated keys, if any
-
executeBatchUpdate
Executes the statement with multiple sets of parameters.- Parameters:
batchParameters- batch parametersgeneratedKeysRequest-nullorfalseif generated keys are not needed,trueif generated keys should be configured automatically,int[]to specify column indices to return generated keys from, orString[]to specify column names to return generated keys from- Returns:
- result of batch execution
-
stop
void stop(boolean commitIfAutoCommit) Stop the command execution, release all locks and resources.- Parameters:
commitIfAutoCommit- commit the session if auto-commit is enabled
-
close
void close()Close the statement.- Specified by:
closein interfaceAutoCloseable
-
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
-