The JDBC specification (like the ODBC specification) acknowledges the fact that some vendor specific SQL may be required for certain RDBMS features. To aid developers in writing portable JDBC applications across multiple database products, a special escape syntax is used to specify the generic commands the developer wants to be run. The JDBC driver translates these escape sequences into native syntax for its specific database. For more information consult the section 4.1.5 from the JDBC Technology Guide (bundled with the Sun™ JRE documentation) and the section 13.4 from the JDBC 3.0 specification.
The parsing of the sql statements for these escapes can be disabled using Statement.setEscapeProcessing(false)
.
Connection.nativeSQL(String sql)
provides another way to have escapes processed.
It translates the given SQL to a SQL suitable for the PostgreSQL™ backend.