SQLJ Basic Language Constructs

SQLJ statements always begin with a #sql token and can be broken into two categories:

  • Declarations— These can be used to create Java classes for iterators (for processing results similar to result sets of JDBC) or connection contexts (used to establish database connections).

  • Executable statements— These can be used to execute embedded SQL statements.

SQLJ Declarations

As mentioned earlier, SQLJ declarations can be either iterator declarations or connection context declarations. An iterator is defined as an instance of a iterator class and is used (similar to JDBC result sets) to process queries that can return multiple rows. Similarly, each database connection is implemented in SQLJ as an instance of a connection ...

Get e-Commerce Applications Using Oracle8i and Java from Scratch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.