SQLJ connection-declaration-clause
The connection declaration clause declares a connection to a data source in an
SQLJ application program.
Syntax
Java-modifiers
context Java-class-name
implements-clause with-clause
Description
Java-modifiers
Specifies modifiers that are valid for Java class declarations, such as static,
public, private, or protected.
Java-class-name
Specifies a valid Java identifier. During the program preparation process, SQLJ
generates a connection context class whose name is this identifier.
implements-clause
See ″SQLJ implements-clause″ for a description of this clause. In a connection
declaration clause, the interface class to which the implements clause refers
must be a user-defined interface class.
with-clause
See ″SQLJ with-clause″ for a description of this clause.
Usage notes
v SQLJ generates a connection class declaration for each connection declaration
clause you specify. SQLJ data source connections are objects of those generated
connection classes.
v You can specify a connection declaration clause anywhere that a Java class
definition can appear in a Java program.
Related tasks
“Connecting to a data source using SQLJ” on page 103
Related reference
“SQLJ clause” on page 281
“SQLJ implements-clause” on page 282
“SQLJ with-clause” on page 283
SQLJ iterator-declaration-clause
An iterator declaration clause declares a positioned iterator class or a named
iterator class in an SQLJ application program.
An iterator contains the result table from a query. SQLJ generates an iterator class
for each iterator declaration clause you specify. An iterator is an object of an
iterator class.
An iterator declaration clause has a form for a positioned iterator and a form for a
named iterator. The two kinds of iterators are distinct and incompatible Java types
that are implemented with different interfaces.
Chapter 7. JDBC and SQLJ reference information 285