de.mguennewig.pobjects
Class Command

java.lang.Object
  extended by de.mguennewig.pobjects.Command

public class Command
extends java.lang.Object

Common base class for command classes.

Each subclass provides exactly one SQL statement which does not return any results over the PObjects interface.

Author:
Michael Günnewig

Constructor Summary
Command(JdbcContainer container, CommandDecl statement)
          Creates a new Command.
 
Method Summary
 void addArguments(java.lang.Object[] args)
           
 int execute()
          Executes the command.
 int execute(java.lang.Object[] args)
          Executes the command with the given set of arguments.
 java.lang.Object getArgument(int idx)
           
 CommandDecl getCommandDecl()
           
 JdbcContainer getContainer()
           
 int getNumArguments()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Command

public Command(JdbcContainer container,
               CommandDecl statement)
Creates a new Command.

Method Detail

getContainer

public final JdbcContainer getContainer()

getCommandDecl

public final CommandDecl getCommandDecl()

addArguments

public final void addArguments(java.lang.Object[] args)
Throws:
java.lang.IllegalArgumentException - if null has been passed or the list is not of same size as number of input parameters exist.
See Also:
FormDecl.getNumEntries()

getNumArguments

public final int getNumArguments()

getArgument

public final java.lang.Object getArgument(int idx)

execute

public final int execute()
                  throws PObjSQLException
Executes the command.

Throws:
java.lang.IllegalStateException - if arguments are needed but have not been initialized yet.
PObjSQLException - if any database error occurs.
See Also:
addArguments(Object[])

execute

public final int execute(java.lang.Object[] args)
                  throws PObjSQLException
Executes the command with the given set of arguments.

Throws:
java.lang.IllegalArgumentException - if null has been passed or the list is not of same size as number of input parameters exist.
PObjSQLException - if any database error occurs.
See Also:
addArguments(Object[]), execute()