skip to main content
SQL escape sequences for JDBC : Native and refresh escape sequences
  

Try DataDirect Drivers Now

Native and refresh escape sequences

The following drivers support Native and Refresh Escape Sequences:
*Apache Cassandra
*Salesforce
Native and Refresh escape sequences provide a method to embed data store-specific commands in SQL-92 statements. The Native escape sequence allows you to execute native commands directly through the client application, while the Refresh escape sequence is used to incorporate any changes introduced by the Native escape into the driver's relational map of the data.
Note: The Native and Refresh escape sequences are mainly intended for the execution of DDL commands, such as ALTER, CREATE, and DROP. A returning clause for the Native escape is not currently supported by the driver. Therefore, results cannot be retrieved using the Native escape sequence.
The Native escape sequences can be used with the following syntax:
{native(command_text)}
where:
command_text
is a data store-specific command.
The Refresh escape sequence has no additional argument and takes the form:
{refresh}
The following example shows the execution of two data store-specific commands with a refresh of the driver's relational map of the data. Note that each Native escape sequence must have its own execute method. The Refresh escape, however, can be used in the same execute statement as the Native escape.
stmt.executeUpdate ("{native (CREATE TABLE emp (empid int, title varchar))}");
stmt.executeUpdate ("{native (CREATE TABLE dept (deptid int, city varchar))}{refresh}");