What's wrong with setting the query inside IReport? In fact weighing maintenance issue, changing the report itself vs changing
java code and recompiling and deploying. Which one would you prefer.
Besides having the query in IReport can cater for requirement change such as add in a new field or remove one field, add a summary section or whatever you or the client can think of.
The java side for all report generation is basically the same. The only difference is the number of parameters (from your app) you need to pass into the report if any.