DB2 Version 9.7 for Linux, UNIX, and Windows

SQL statement execution in SQLJ applications

You execute SQL statements in a traditional SQL program to create tables, update data in tables, retrieve data from the tables, call stored procedures, or commit or roll back transactions. In an SQLJ program, you also execute these statements, within SQLJ executable clauses.

An executable clause can have one of the following general forms:
#sql [connection-context] {sql-statement};
#sql [connection-context,execution-context] {sql-statement};
#sql [execution-context] {sql-statement};
execution-context specification
In an executable clause, you should always specify an explicit connection context, with one exception: you do not specify an explicit connection context for a FETCH statement. You include an execution context only for specific cases. See "Control the execution of SQL statements in SQLJ" for information about when you need an execution context.
connection-context specification
In an executable clause, if you do not explicitly specify a connection context, the executable clause uses the default connection context.