Tuscany DAS for Relational Databases

org.apache.tuscany.das.rdb
Interface Command

All Known Implementing Classes:
CommandImpl, DeleteCommandImpl, InsertCommandImpl, OptimisticWriteCommandImpl, ReadCommandImpl, SPCommandImpl, UpdateCommandImpl, WriteCommandImpl

public interface Command

A Command is used to execute a read or write to a database


Field Summary
static CommandFactory FACTORY
           
 
Method Summary
 void addParameter(int index, int direction, commonj.sdo.Type sdoType)
          Adds a Parameter to the command
 void addParameter(int index, commonj.sdo.Type sdoType)
          Adds a Parameter to the command
 void addParameter(java.lang.String name, int direction, commonj.sdo.Type sdoType)
          Adds a Parameter to the command
 void addParameter(java.lang.String name, commonj.sdo.Type sdoType)
          Adds a Parameter to the command
 void close()
          Cleans up and realeases all resources associated with this command.
 void execute()
          Performs the function defined by the command
 commonj.sdo.DataObject executeQuery()
          Performs the function defined by the command and return the results in the root DataObject
 Parameter getParameter(int index)
          Returns the Parameter at index
 Parameter getParameter(java.lang.String name)
          Returns the parameter associated with "name"
 java.lang.Object getParameterValue(int index)
          Returns the value of the associated Parameter
 java.lang.Object getParameterValue(java.lang.String name)
          Returns the value of the associated Parameter
 void setConnection(java.sql.Connection connection)
          Provides the java.sql.Connection to be used for this executing this command.
 void setConnection(java.sql.Connection connection, boolean manageTransactions)
          Provides the java.sql.Connection to be used for this executing this command.
 void setDataObjectModel(commonj.sdo.Type schema)
          Specifies an object model for a graph of DataObjects returned by #executeQuery()
 void setParameterType(int index, commonj.sdo.Type dataType)
          Sets the "type" of the associated Parameter
 void setParameterType(java.lang.String string, commonj.sdo.Type dataType)
          Sets the "type" of the associated Parameter
 void setParameterValue(int index, java.lang.Object value)
          Sets the value of the associated Parameter
 void setParameterValue(java.lang.String name, java.lang.Object value)
          Sets the value of the named Parameter
 void setResultSetShape(ResultSetShape shape)
          Defines the structure of the ResultSet returned by the JDBC Driver when this command is executed.
 

Field Detail

FACTORY

static final CommandFactory FACTORY
Method Detail

execute

void execute()
Performs the function defined by the command


executeQuery

commonj.sdo.DataObject executeQuery()
Performs the function defined by the command and return the results in the root DataObject

Returns:
the root DataObject

getParameter

Parameter getParameter(java.lang.String name)
Returns the parameter associated with "name"

Parameters:
name - the name of the parameter
Returns:
the associated parameter

getParameter

Parameter getParameter(int index)
Returns the Parameter at index

Parameters:
index - the index of the Parameter
Returns:
the associated Parameter

setParameterValue

void setParameterValue(java.lang.String name,
                       java.lang.Object value)
Sets the value of the named Parameter

Parameters:
name - the name of this Parameter
value - the value for the Parameter

setParameterValue

void setParameterValue(int index,
                       java.lang.Object value)
Sets the value of the associated Parameter

Parameters:
index - the index of the Parameter
value - the value for the Parameter

setParameterType

void setParameterType(java.lang.String string,
                      commonj.sdo.Type dataType)
Sets the "type" of the associated Parameter

Parameters:
name - the name of this Parameter
type - the SDODataTypes-defined "type" for the Parameter.

setParameterType

void setParameterType(int index,
                      commonj.sdo.Type dataType)
Sets the "type" of the associated Parameter

Parameters:
index - the index of the Parameter
type - the SDODataTypes-defined "type" for the Parameter.

getParameterValue

java.lang.Object getParameterValue(java.lang.String name)
Returns the value of the associated Parameter

Parameters:
name - the name of the Parameter
Returns:
the value of the Parameter

getParameterValue

java.lang.Object getParameterValue(int index)
Returns the value of the associated Parameter

Parameters:
index - the index of the Parameter
Returns:
the value of the Parameter

addParameter

void addParameter(int index,
                  commonj.sdo.Type sdoType)
Adds a Parameter to the command

Parameters:
index - the index of the parameter
sdoType - the commonj.sdo.Type of the Parameter

addParameter

void addParameter(java.lang.String name,
                  commonj.sdo.Type sdoType)
Adds a Parameter to the command

Parameters:
name - the index of the parameter
sdoType - the commonj.sdo.Type of the Parameter

addParameter

void addParameter(int index,
                  int direction,
                  commonj.sdo.Type sdoType)
Adds a Parameter to the command

Parameters:
index - the index of the parameter
direction - the direction of the Parameter. Either Parameter.IN, Parameter.OUT or Parameter.INOUT
sdoType - specifies the type as a commonj.sdo.Type from SDODataTypes

addParameter

void addParameter(java.lang.String name,
                  int direction,
                  commonj.sdo.Type sdoType)
Adds a Parameter to the command

Parameters:
name - the name associated with the Parameter
direction - the direction of the Parameter. Either Parameter.IN, Parameter.OUT or Parameter.INOUT
sdoType - specifies the type as a commonj.sdo.Type from SDODataTypes

setDataObjectModel

void setDataObjectModel(commonj.sdo.Type schema)
Specifies an object model for a graph of DataObjects returned by #executeQuery()

Parameters:
schema - the model as a commonj.sdo.Type

setResultSetShape

void setResultSetShape(ResultSetShape shape)
Defines the structure of the ResultSet returned by the JDBC Driver when this command is executed. If the shape is not specified then the shape is taken from the ResultSetMetatadta instance provided by the JDBC Driver.

This method is prvided primarily to support platforms (such as Oracle) that do not provide complete support for ResultSetMetadata

Parameters:
shape - the specified result set shape
See Also:
ResultSetShape

setConnection

void setConnection(java.sql.Connection connection)
Provides the java.sql.Connection to be used for this executing this command.

Parameters:
connection - the java.sql.Connection

setConnection

void setConnection(java.sql.Connection connection,
                   boolean manageTransactions)
Provides the java.sql.Connection to be used for this executing this command.

Parameters:
connection - the java.sql.Connection
manageTransactions - true if the DAS should perform tx commit/rollback

close

void close()
Cleans up and realeases all resources associated with this command. This should be called when the application is done with this command.


Tuscany DAS for Relational Databases

-