Native and Refresh Escape Sequences
- Last Updated: August 10, 2016
- 1 minute read
- DataDirect Connectors
- JDBC
- Apache Cassandra 6.0
- Documentation
The driver supports the Native and Refresh escape sequences 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.
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}");