You've been there: you want to write a SQL query, test it, and then paste it into Java. But Java requires a string that is concatenated with '+' for readability. What a pain to have to go back and forth between the query editor and the Java editor.
Wade Chandler (our hero again) has written a nice plugin that let's you convert back and forth between "Java-style" string-concatenated text and "plain style" of SQL and other plain text editors. Wade explains this more in this email.
Here's an example. I start with a nice long query in the query editor that does what I want it to do...
Then I use Wade's plugin to paste into Java: