EasyManuals Logo

IBM DB2 User Manual

IBM DB2
585 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #128 background imageLoading...
Page #128 background image
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

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM DB2 and is the answer not in the manual?

IBM DB2 Specifications

General IconGeneral
DeveloperIBM
Initial Release1983
LicenseProprietary
Written inC, C++
CategoryDatabase Management System (RDBMS)
Operating SystemLinux, Windows
Programming LanguagesC, C++
Data ModelsRelational
EditionsCommunity, Standard, Advanced
Key Featureshigh availability, scalability