1

I want to use sql static queries in my reader class. But queries are quite big hence not adding to xml file. Then how to write multiple queries in reader class ?

Thanks in advance

1 Answer 1

2

quick and dirty; just extend JdbcCursorItemReader and set the sql from there:

public class StaticSqlJdbcCursorItemReader extends JdbcCursorItemReader {
    //extend your reader
  public static final STATIC_SQL = "select * from ..." 

  public StaticSqlJdbcCursorItemReader() {
        setSql(STATIC_SQL);
    }

}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.