Announcement Announcement Module
Collapse
No announcement yet.
SqlPagingQueryProviderFactoryBean union of multiple queries Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SqlPagingQueryProviderFactoryBean union of multiple queries

    I am using Spring Batch. I have a sql statement which is built up from multiple xml file elements. All of the results come from the same table, but each of the statements have a different XXX as keyValue. I have extended both a JdbcCursorItemReader, where I use a setSql to set the sql String and this works fine. However performance isn't great and it can't be multithreaded. I then switched to extending a SqlPagingQueryProviderFactoryBean and adding a thread pool executor to my tasklet and for one simple sql statement I have noticed a significant decrease in time. What I need to know is how to use my complex sql with unions and the SqlPagingQueryProviderFactoryBean, is this possible. Surely this component can deal with more than a simple select from where clause.

    Thanks

    John

  • #2
    Can you post an example of the query you are attempting to execute?

    Comment


    • #3
      the query was to be a join of multiple tables with multiple where conditions in each query.
      From what I've read on JdbcCursorItemReader, this isn't possible. One possible solution is to get a DBA to create a view which can then be selected from using a PagingReader. This isn't valid in this case as the query is generated from input files into a sql batch operation.

      Comment

      Working...
      X