org.h2.command
Class CommandContainer

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

public class CommandContainer
extends Command

Represents a single SQL statements. It wraps a prepared statement.


Field Summary
 
Fields inherited from class org.h2.command.Command
session, startTime, trace
 
Method Summary
 ObjectArray<? 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.
 LocalResult query(int maxrows)
          Execute a query statement, if this is possible.
 LocalResult 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, executeQueryLocal, executeUpdate, getMetaData, getMetaDataLocal, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getParameters

public ObjectArray<? 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

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

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

update

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

Overrides:
update in class Command
Returns:
the update count
Throws:
java.sql.SQLException - if the command is not an updating statement

query

public LocalResult query(int maxrows)
                  throws java.sql.SQLException
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
Throws:
java.sql.SQLException - if the command is not a query

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 LocalResult queryMeta()
                      throws java.sql.SQLException
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
Throws:
java.sql.SQLException