PureQueryReaderPattern

使用此模式以从使用 IBM® Optim™ pureQuery Runtime 的数据库读取数据。批处理数据流 (BDS) 框架完成打开和关闭连接的管理任务。

支持类

PureQueryReader 类实现打开和关闭数据库连接以及获取 IBM Optim pureQuery Runtime 数据的基本操作。

必需属性

以下属性对于该模式是必需的。

表 1. 必需属性. 该表包含此模式的每个必需属性的名称和值。
属性名称
PATTERN_IMPL_CLASS 实现 PureQueryReaderPattern 接口的类
PQ_DATA_BEAN_INTERFACE PureQuery 数据 bean 接口
ds_jndi_name 用于访问数据库的数据源的 Java™ 命名和目录接口 (JNDI) 名称

可选属性

以下属性对于该模式是可选的。

表 2. 可选属性. 该表包含此模式的每个可选属性的名称、值和描述。
属性名称 描述
debug true 或 false(缺省值为 false。) 在此批处理数据流上启用详细跟踪
DB_SCHEMA null 数据库模式名称
EnablePerformanceMeasurement true 或 false(缺省值为 false。) 如果正使用 GenericXDBatchStep,那么计算批处理数据流和 processRecord 方法中所花的总时间

接口定义

PureQueryReaderPattern 接口定义显示必须实现以支持 PureQueryReaderPattern 接口的方法。

public interface PureQueryReaderPattern
{

	/**
	 	 * This method is called by the batch container during step setup. The properties passed
	 	 * in are the ones that you provide in the xJCL BDS level properties.
	 * @param properties
	 */
    public  void initialize(Properties properties);

    /**
     * Invoked by the container during each iteration of the batch loop. This code obtains
     * the next record using the given iterator object.
     * @param iterator
     * @return
     */
    public  Object fetchRecord(Iterator iterator);

    /**
     * Returns the iterator based on the passed data object that is used to iterate 
     * over the records
     * @param data
     * @return
     */
    public  Iterator getInitialIterator(Data data);

    /**
     * Returns the iterator based on the passed data object repositioned based on the restart
     * token of restartToken.
     * @param data
     * @param s
     * @return
     */
    public  Iterator getRestartIterator(Data data, String restartToken);

    /**
     * Invoked before a checkpoint is taken to save the restart token that is used in case 
     * of a restart
     * @return
     */
    public  String getRestartTokens();
}   

xJCL 示例

该示例显示 xJCL,可将此 xJCL 用于定义在应用程序中实现 PureQueryReaderPattern 接口的批处理数据流。

<batch-data-streams>
	 <bds>
 		<logical-name>outputStream</logical-name>
 		<props>
 						<prop name="IMPLCLASS" value="com.ibm.MyWriterPattern"/>
               <prop name="ds_jndi_name" value="jdbc/crreport"/>
               	<prop name="debug" value="true"/>  
               <prop name="DB_SCHEMA" value="PQDS"/>
               <prop name="PQ_DATA_BEAN_INTERFACE" value="com.ibm.MyEmployeeData"/>
 			</props>
 						<impl-class>com.ibm.websphere.batch.devframework.datastreams.patterns.PureQueryReader</impl-class>
  </bds></batch-data-streams> 

指示主题类型的图标 参考主题



时间戳记图标 最近一次更新时间: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=rgrid_btchpttrn12
文件名:rgrid_btchpttrn12.html