Topic
  • 4 replies
  • Latest Post - ‏2012-02-28T15:21:31Z by SystemAdmin
nvreddy
nvreddy
15 Posts

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

    Re: Passing the Query Dynamically for JDBC Writer Pattern.

    ‏2011-05-11T20:16:04Z  
    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

    Re: Passing the Query Dynamically for JDBC Writer Pattern.

    ‏2011-05-12T00:28:31Z  
    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.
    Thanks, Chris.

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

    Re: Passing the Query Dynamically for JDBC Writer Pattern.

    ‏2012-02-27T17:46:51Z  
    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

    Re: Passing the Query Dynamically for JDBC Writer Pattern.

    ‏2012-02-28T15:21:31Z  
    • Jacobus
    • ‏2012-02-27T17:46:51Z
    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.
    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.