I am asking is there any specific reason for keeping the query out of the java file.
1. Ease of changing the query without having to recompile
2. Facilitates record keeping, you can document the query using XSLT to create a nicely formatted record.
3. Reduced chance of introducing errors into Java file
4. Facilitate use by non-java-programmers
5. Probably, better security but I'm not sure about that