com.iplanet.jato.model.sql
Class DatasetSQLModelExecutionContext

java.lang.Object
  |
  +--com.iplanet.jato.model.ModelExecutionContextBase
        |
        +--com.iplanet.jato.model.DatasetModelExecutionContextImpl
              |
              +--com.iplanet.jato.model.sql.DatasetSQLModelExecutionContext
All Implemented Interfaces:
DatasetModelExecutionContext, ModelExecutionContext, SQLModelExecutionContext
Direct Known Subclasses:
SelectQueryExecutionContext

public class DatasetSQLModelExecutionContext
extends DatasetModelExecutionContextImpl
implements SQLModelExecutionContext

An execution context used to execute dataset operations on QueryModels (normally SQL SELECT operations). Developers can specify both the dataset offset and size, as well as a JDBC connection or statement object, to be used during execution of the model.

By providing a connection or statement object to the model via this context, developers can maintain control of the transaction state of the connection instead of relying on the default behavior (which is generally equivalent to auto-commit semantics). However, such use also introduces a measure of responsibilty on the developer--because providing these objects to the model manually causes the model to avoid any connection lifecycle management of its own, the developer is completely responsible for managing the lifecycle of the connection, as well as the lifecycle of any transactions that might be pending on that connection.

In general, if the developer supplies a connection object, he or she need not also supply a statement object. Conversely, if the developer supplies a statement object, he or she need not specify a connection object (though he will need to keep a reference to the connection object used to create the statement in order to close it after execution is complete). In both cases, the developer is ultimately responsible for releasing the connection manually when use of it is complete.

Version:
JATO/1.2.2 $Id: DatasetSQLModelExecutionContext.java,v 1.6 2002/03/16 03:26:32 todd Exp $

Fields inherited from interface com.iplanet.jato.model.ModelExecutionContext
OPERATION_DELETE, OPERATION_EXECUTE, OPERATION_INSERT, OPERATION_RETRIEVE, OPERATION_UPDATE
 
Fields inherited from interface com.iplanet.jato.model.DatasetModelExecutionContext
DATASET_OFFSET_BEGINNING, DATASET_OFFSET_END, DATASET_SIZE_ALL_INCREMENTAL, DATASET_SIZE_ALL_PREFETCH
 
Constructor Summary
DatasetSQLModelExecutionContext()
          Default constructor The operation name is implicitly set to ModelExecutionContext.OPERATION_RETRIEVE.
DatasetSQLModelExecutionContext(java.sql.Connection connection)
          Constructs an instance using the specified connection object The operation name is implicitly set to ModelExecutionContext.OPERATION_RETRIEVE.
DatasetSQLModelExecutionContext(java.sql.Connection connection, int datasetOffset, int datasetSize)
          Constructs an instance using the specified connection object, dataset offset and size
DatasetSQLModelExecutionContext(int datasetOffset, int datasetSize)
          Constructs an instance using the specified dataset offset and size
DatasetSQLModelExecutionContext(java.sql.Statement statement)
          Constructs an instance using the specified statement object The operation name is implicitly set to ModelExecutionContext.OPERATION_RETRIEVE.
DatasetSQLModelExecutionContext(java.sql.Statement statement, int datasetOffset, int datasetSize)
          Constructs an instance using the specified statement object, dataset offset and size
 
Method Summary
 java.sql.Connection getConnection()
          Returns the JDBC connection object that should be used for execution.
 java.sql.Statement getStatement()
          Returns the JDBC statement object that should be used for execution.
 void setConnection(java.sql.Connection value)
          Sets the connection object to be used during execution.
 void setStatement(java.sql.Statement value)
          Sets the statement object to be used during execution.
 
Methods inherited from class com.iplanet.jato.model.DatasetModelExecutionContextImpl
getDatasetOffset, getDatasetSize, setDatasetOffset, setDatasetSize
 
Methods inherited from class com.iplanet.jato.model.ModelExecutionContextBase
getOperationName, setOperationName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.iplanet.jato.model.ModelExecutionContext
getOperationName
 

Constructor Detail

DatasetSQLModelExecutionContext

public DatasetSQLModelExecutionContext()
Default constructor The operation name is implicitly set to ModelExecutionContext.OPERATION_RETRIEVE. The dataset offset is implicitly set to DatasetModelExecutionContext.DATASET_OFFSET_BEGINNING. The dataset size is implicitly set to DatasetModelExecutionContext.DATASET_SIZE_ALL_INCREMENTAL.

DatasetSQLModelExecutionContext

public DatasetSQLModelExecutionContext(int datasetOffset,
                                       int datasetSize)
Constructs an instance using the specified dataset offset and size

DatasetSQLModelExecutionContext

public DatasetSQLModelExecutionContext(java.sql.Connection connection)
Constructs an instance using the specified connection object The operation name is implicitly set to ModelExecutionContext.OPERATION_RETRIEVE. The dataset offset is implicitly set to DatasetModelExecutionContext.DATASET_OFFSET_BEGINNING. The dataset size is implicitly set to DatasetModelExecutionContext.DATASET_SIZE_ALL_INCREMENTAL.

DatasetSQLModelExecutionContext

public DatasetSQLModelExecutionContext(java.sql.Connection connection,
                                       int datasetOffset,
                                       int datasetSize)
Constructs an instance using the specified connection object, dataset offset and size

DatasetSQLModelExecutionContext

public DatasetSQLModelExecutionContext(java.sql.Statement statement)
Constructs an instance using the specified statement object The operation name is implicitly set to ModelExecutionContext.OPERATION_RETRIEVE. The dataset offset is implicitly set to DatasetModelExecutionContext.DATASET_OFFSET_BEGINNING. The dataset size is implicitly set to DatasetModelExecutionContext.DATASET_SIZE_ALL_INCREMENTAL.

DatasetSQLModelExecutionContext

public DatasetSQLModelExecutionContext(java.sql.Statement statement,
                                       int datasetOffset,
                                       int datasetSize)
Constructs an instance using the specified statement object, dataset offset and size
Method Detail

getConnection

public java.sql.Connection getConnection()
Description copied from interface: SQLModelExecutionContext
Returns the JDBC connection object that should be used for execution. In general, if a connection object is provided, a statment object need not be provided (and vice versa).
Specified by:
getConnection in interface SQLModelExecutionContext

setConnection

public void setConnection(java.sql.Connection value)
Sets the connection object to be used during execution. In general, if the developer supplies a connection object, he or she need not also supply a statement object.

getStatement

public java.sql.Statement getStatement()
Description copied from interface: SQLModelExecutionContext
Returns the JDBC statement object that should be used for execution. In general, if a statement object is provided, a connection object need not be provided (and vice versa).
Specified by:
getStatement in interface SQLModelExecutionContext

setStatement

public void setStatement(java.sql.Statement value)
Sets the statement object to be used during execution. In general, if the developer supplies a statement object, he or she need not specify a connection object (though he will need to keep a reference to the connection object used to create the statement in order to close it after execution is complete).