org.axiondb
Interface AxionCommand

All Known Implementing Classes:
AddConstraintCommand, AlterSequenceCommand, AlterTableCommand, BaseAxionCommand, CheckFileStateCommand, ChildTableUpdater, ConstraintCommand, CreateCommand, CreateDatabaseLinkCommand, CreateIndexCommand, CreateSequenceCommand, CreateTableCommand, CreateViewCommand, DefragCommand, DeleteCommand, DropCommand, DropConstraintCommand, DropDatabaseLinkCommand, DropIndexCommand, DropSequenceCommand, DropTableCommand, DropViewCommand, InsertCommand, InsertIntoClause, RemountCommand, SelectCommand, ShutdownCommand, SubSelectCommand, TruncateCommand, UpdateCommand, UpsertCommand

public interface AxionCommand

A command to be executed against a Database.

Version:
$Revision: 1.15 $ $Date: 2005/12/22 09:02:30 $

Method Summary
 void bindAll(java.lang.Object[] values)
          Sets the values of the all bind variable within this command.
 void clearBindings()
          Clears all bind variables within this command.
 boolean execute(Database db)
          Executes an SQL statement that may return multiple results.
 AxionResultSet executeQuery(Database db)
          Executes an SQL statement that returns a single read-only ResultSet object such as a SELECT statement.
 AxionResultSet executeQuery(Database db, boolean isReadOnly)
          Execute an SQL statement that returns a single ResultSet object with the given read-only state.
 int executeUpdate(Database db)
          Executes an SQL that may add, delete or modify zero or more rows within the database, such as an INSERT, UPDATE or DELETE statement.
 java.util.List getBindVariables()
           
 int getEffectedRowCount()
          Returns the last row count generated by execute(org.axiondb.Database) or executeUpdate(org.axiondb.Database).
 java.sql.ResultSet getResultSet()
          Returns the last ResultSet generated by execute(org.axiondb.Database) or executeQuery(org.axiondb.Database).
 

Method Detail

bindAll

void bindAll(java.lang.Object[] values)
             throws AxionException
Sets the values of the all bind variable within this command.

Parameters:
index - the one-based index of the variable
value - the value to bind the variable to
Throws:
AxionException

clearBindings

void clearBindings()
                   throws AxionException
Clears all bind variables within this command.

Throws:
AxionException

execute

boolean execute(Database db)
                throws AxionException
Executes an SQL statement that may return multiple results.

Returns:
true if one or more ResultSets were generated, false otherwise
Throws:
AxionException
See Also:
Statement.execute(java.lang.String), PreparedStatement.execute()

executeQuery

AxionResultSet executeQuery(Database db)
                            throws AxionException
Executes an SQL statement that returns a single read-only ResultSet object such as a SELECT statement.

Returns:
the generated ResultSet
Throws:
AxionException
See Also:
Statement.executeQuery(java.lang.String), PreparedStatement.executeQuery()

executeQuery

AxionResultSet executeQuery(Database db,
                            boolean isReadOnly)
                            throws AxionException
Execute an SQL statement that returns a single ResultSet object with the given read-only state.

Parameters:
db - Database in which query will be executed
isReadOnly - true if statement is read-only, false otherwise
Returns:
the generated ResultSet
Throws:
AxionException

executeUpdate

int executeUpdate(Database db)
                  throws AxionException
Executes an SQL that may add, delete or modify zero or more rows within the database, such as an INSERT, UPDATE or DELETE statement. In addition, SQL statements that return nothing, such as SQL DDL statements, can be executed via this method.

Returns:
the number of rows modified
Throws:
AxionException
See Also:
Statement.executeUpdate(java.lang.String), PreparedStatement.executeUpdate()

getBindVariables

java.util.List getBindVariables()

getEffectedRowCount

int getEffectedRowCount()
Returns the last row count generated by execute(org.axiondb.Database) or executeUpdate(org.axiondb.Database).


getResultSet

java.sql.ResultSet getResultSet()
Returns the last ResultSet generated by execute(org.axiondb.Database) or executeQuery(org.axiondb.Database).