org.axiondb
Interface AxionCommand

All Known Implementing Classes:
BaseAxionCommand

public interface AxionCommand

A command to be executed against a Database.

Version:
$Revision: 1.11 $ $Date: 2004/08/27 03:21:21 $

Method Summary
 void bind(int index, Object value)
          Sets the value of the ith 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 ResultSet object such as a SELECT statement.
 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.
 int getEffectedRowCount()
          Returns the last row count generated by execute(org.axiondb.Database) or executeUpdate(org.axiondb.Database).
 ResultSet getResultSet()
          Returns the last ResultSet generated by execute(org.axiondb.Database) or executeQuery(org.axiondb.Database).
 

Method Detail

bind

public void bind(int index,
                 Object value)
          throws AxionException
Sets the value of the ith 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

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

Throws:
AxionException

execute

public 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

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

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

executeUpdate

public 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()

getEffectedRowCount

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


getResultSet

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