JDBC escape syntax
Derby Reference Manual
323
JDBC 4.1 adds new features to the Connection interface:
· Aborting connections - The abort(Executor) method aborts a running connection.
Outstanding transactional work is rolled back, and the physical connection to the
database is destroyed. When running under a Java SecurityManager, this method
can be called only if SQLPermission("callAbort") has been granted both to the
Derby JDBC driver (in derby.jar and derbyclient.jar) and to the application code
that calls Connection.abort(). For security reasons, permission to execute this
method should not be granted lightly. Do not grant this permission to application
code unless you are certain that only superusers can invoke the code. For more
information, see "Granting permissions to Derby" in the Derby Developer's Guide.
JDBC escape syntax
JDBC provides a way of smoothing out some of the differences in the way different
DBMS vendors implement SQL. This is called escape syntax. Escape syntax signals
that the JDBC driver, which is provided by a particular vendor, scans for any escape
syntax and converts it into the code that the particular database understands. This makes
escape syntax DBMS-independent.
A JDBC escape clause begins and ends with curly braces. A keyword always follows the
opening curly brace:
{keyword }
Derby supports the following JDBC escape keywords, which are case-insensitive:
·
The escape keyword for use in CallableStatements.
·
The keyword for specifying escape characters for LIKE clauses.
·
The escape keyword for scalar functions.
·
The escape keyword for outer joins.
·
The escape keyword for time formats.
·
The escape keyword for date formats.
·
The escape keyword for timestamp formats.
Other JDBC escape keywords are not supported.
Note: Derby returns the SQL unchanged in the Connection.nativeSQL call,
since the escape syntax is native to SQL. In addition, it is unnecessary to call
Statement.setEscapeProcessing for this reason.
JDBC escape keyword for call statements
This syntax is supported for a java.sql.Statement and a java.sql.PreparedStatement in
addition to a CallableStatement.
Syntax
{call statement }