Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
4 replies Latest Post - ‏2012-02-28T15:21:31Z by SystemAdmin
nvreddy
nvreddy
15 Posts
ACCEPTED ANSWER

Pinned topic Passing the Query Dynamically for JDBC Writer Pattern.

‏2011-05-10T22:28:11Z |
Is there any way we can pass the query dynamically for OutputStream.write() method for JDBCWriterPattern as we are doing similar thing for JDBCReaderPattern

InputStream.read(Sql) -- Which retuns the object for the passed query.

Please let me know, If there is any mechanism to do this.

Thanks.
NVReddy
Updated on 2012-02-28T15:21:31Z at 2012-02-28T15:21:31Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    783 Posts
    ACCEPTED ANSWER

    Re: Passing the Query Dynamically for JDBC Writer Pattern.

    ‏2011-05-11T20:16:04Z  in response to nvreddy
    The existing JDBCWriter does not have a write(sql) method. You are free to subclass the framework patterns, which would be the easiest way to add such a capability.
    • nvreddy
      nvreddy
      15 Posts
      ACCEPTED ANSWER

      Re: Passing the Query Dynamically for JDBC Writer Pattern.

      ‏2011-05-12T00:28:31Z  in response to SystemAdmin
      Thanks, Chris.

      I will try looking into it.
  • Jacobus
    Jacobus
    1 Post
    ACCEPTED ANSWER

    Re: Passing the Query Dynamically for JDBC Writer Pattern.

    ‏2012-02-27T17:46:51Z  in response to nvreddy
    Hi, I am new to the Java Batch and I am trying to dynamically pass in a query for the JPAReaderPattern. Does anyone have a example of this would work? What does the JCL and batch data stream look like?

    Thank you.
    • SystemAdmin
      SystemAdmin
      783 Posts
      ACCEPTED ANSWER

      Re: Passing the Query Dynamically for JDBC Writer Pattern.

      ‏2012-02-28T15:21:31Z  in response to Jacobus
      The JPAReader has a read(pql) method, but I am unware of a sample that uses it. Typical usage of data stream readers is to use the position* methods for initial and restart positioning of the stream for sequential reading.

      Recommendation:

      Review JPA Configuration Post.

      Review com.ibm.websphere.batch.devframework.datastreams.patterns.JPAReader in batchframework.jar, available in WWCG v8 Eclipse Sample Workspace.

      Refer to attached sample application for further example code.