Comments In An Sqlj Application; Sql Statement Execution In Sqlj Applications - IBM DB2 Manual

Table of Contents

Advertisement

v The string __sJT_ is a reserved prefix for variable names that are generated by
v The string _SJ is a reserved suffix for resource files and classes that are

Comments in an SQLJ application

To document your SQLJ program, you need to include comments. To do that, use
Java comments. Java comments are denoted by /* */ or //.
You can include Java comments outside SQLJ clauses, wherever the Java language
permits them. Within an SQLJ clause, you can use Java comments in the following
places:
v Within a host expression (/* */ or //).
v Within an SQL statement in an executable clause, if the data source supports a

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
112
Application Programming Guide and Reference for Java
SQLJ. Do not begin the following types of names with __sJT_:
– Host expression names
– Java variable names that are declared in blocks that include executable SQL
statements
– Names of parameters for methods that contain executable SQL statements
– Names of fields in classes that contain executable SQL statements, or in
classes with subclasses or enclosed classes that contain executable SQL
statements
generated by SQLJ. Avoid using the string _SJ in class names and input source
file names.
Related concepts
"Example of a simple SQLJ application" on page 101
Related reference
"Data types that map to database data types in Java applications" on page 193
"SQLJ host-expression" on page 281
comment within the SQL statement (/* */ or --).
/* and */ pairs in an SQL statement can be nested.
Related concepts
"Example of a simple SQLJ application" on page 101
"SQL statement execution in SQLJ applications"
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.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents