v The string __sJT_ is a reserved prefix for variable names that are generated by
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
v The string _SJ is a reserved suffix for resource files and classes that are
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
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
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”
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.
112 Application Programming Guide and Reference for Java
™