org.h2.command
Class CommandList

java.lang.Object
  extended by org.h2.command.Command
      extended by org.h2.command.CommandList
All Implemented Interfaces:
CommandInterface

public class CommandList
extends Command

Represents a list of SQL statements.


Field Summary
 
Fields inherited from class org.h2.command.Command
session, startTime, trace
 
Fields inherited from interface org.h2.command.CommandInterface
ALTER_INDEX_RENAME, ALTER_SCHEMA_RENAME, ALTER_SEQUENCE, ALTER_TABLE_ADD_COLUMN, ALTER_TABLE_ADD_CONSTRAINT_CHECK, ALTER_TABLE_ADD_CONSTRAINT_PRIMARY_KEY, ALTER_TABLE_ADD_CONSTRAINT_REFERENTIAL, ALTER_TABLE_ADD_CONSTRAINT_UNIQUE, ALTER_TABLE_ALTER_COLUMN_CHANGE_TYPE, ALTER_TABLE_ALTER_COLUMN_DEFAULT, ALTER_TABLE_ALTER_COLUMN_NOT_NULL, ALTER_TABLE_ALTER_COLUMN_NULL, ALTER_TABLE_ALTER_COLUMN_RENAME, ALTER_TABLE_ALTER_COLUMN_SELECTIVITY, ALTER_TABLE_DROP_COLUMN, ALTER_TABLE_DROP_CONSTRAINT, ALTER_TABLE_RENAME, ALTER_TABLE_SET_REFERENTIAL_INTEGRITY, ALTER_USER_ADMIN, ALTER_USER_RENAME, ALTER_USER_SET_PASSWORD, ALTER_VIEW, ANALYZE, BACKUP, BEGIN, CALL, CHECKPOINT, CHECKPOINT_SYNC, COMMENT, COMMIT, COMMIT_TRANSACTION, CREATE_AGGREGATE, CREATE_ALIAS, CREATE_CONSTANT, CREATE_DOMAIN, CREATE_INDEX, CREATE_LINKED_TABLE, CREATE_ROLE, CREATE_SCHEMA, CREATE_SEQUENCE, CREATE_TABLE, CREATE_TRIGGER, CREATE_USER, CREATE_VIEW, DEALLOCATE, DELETE, DROP_AGGREGATE, DROP_ALIAS, DROP_ALL_OBJECTS, DROP_CONSTANT, DROP_DOMAIN, DROP_INDEX, DROP_ROLE, DROP_SCHEMA, DROP_SEQUENCE, DROP_TABLE, DROP_TRIGGER, DROP_USER, DROP_VIEW, EXECUTE, EXPLAIN, GRANT, INSERT, MERGE, NO_OPERATION, PREPARE, PREPARE_COMMIT, REVOKE, ROLLBACK, ROLLBACK_TO_SAVEPOINT, ROLLBACK_TRANSACTION, RUNSCRIPT, SAVEPOINT, SCRIPT, SELECT, SET, SET_AUTOCOMMIT_FALSE, SET_AUTOCOMMIT_TRUE, SHUTDOWN, SHUTDOWN_COMPACT, SHUTDOWN_DEFRAG, SHUTDOWN_IMMEDIATELY, TRUNCATE_TABLE, UNKNOWN, UPDATE
 
Constructor Summary
CommandList(Parser parser, java.lang.String sql, Command c, java.lang.String remaining)
           
 
Method Summary
 int getCommandType()
          Get command type.
 java.util.ArrayList<? extends ParameterInterface> getParameters()
          Get the list of parameters.
 boolean isQuery()
          Check if this command is a query.
 boolean isReadOnly()
          Check if this command is read only.
 boolean isTransactional()
          Check if this command is transactional.
 ResultInterface query(int maxrows)
          Execute a query statement, if this is possible.
 ResultInterface queryMeta()
          Get an empty result set containing the meta data.
 int update()
          Execute an updating statement, if this is possible.
 
Methods inherited from class org.h2.command.Command
cancel, checkCanceled, close, executeQuery, executeUpdate, getMetaData, isCacheable, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommandList

public CommandList(Parser parser,
                   java.lang.String sql,
                   Command c,
                   java.lang.String remaining)
Method Detail

getParameters

public java.util.ArrayList<? extends ParameterInterface> getParameters()
Description copied from class: Command
Get the list of parameters.

Specified by:
getParameters in interface CommandInterface
Specified by:
getParameters in class Command
Returns:
the list of parameters

update

public int update()
Description copied from class: Command
Execute an updating statement, if this is possible.

Overrides:
update in class Command
Returns:
the update count

query

public ResultInterface query(int maxrows)
Description copied from class: Command
Execute a query statement, if this is possible.

Overrides:
query in class Command
Parameters:
maxrows - the maximum number of rows returned
Returns:
the local result set

isQuery

public boolean isQuery()
Description copied from class: Command
Check if this command is a query.

Specified by:
isQuery in interface CommandInterface
Specified by:
isQuery in class Command
Returns:
true if it is

isTransactional

public boolean isTransactional()
Description copied from class: Command
Check if this command is transactional. If it is not, then it forces the current transaction to commit.

Specified by:
isTransactional in class Command
Returns:
true if it is

isReadOnly

public boolean isReadOnly()
Description copied from class: Command
Check if this command is read only.

Specified by:
isReadOnly in class Command
Returns:
true if it is

queryMeta

public ResultInterface queryMeta()
Description copied from class: Command
Get an empty result set containing the meta data.

Specified by:
queryMeta in class Command
Returns:
an empty result set

getCommandType

public int getCommandType()
Description copied from interface: CommandInterface
Get command type.

Returns:
one of the constants above