Querydsl, the type-safe query language for Java, provides now generic support for custom SQL dialects in its SQL module.

See the following forum thread which provides examples for MySQL and Oracle : http://source.mysema.com/forum/mvnforum/viewthread_thread,96

What are your approaches to using SQL with J2EE? Plain JDBC? Spring JDBC? Something else?