IBM Informix Embedded SQLJ User's Guide

######

IBM Informix Embedded SQLJ User's Guide Chapter 4: The Embedded SQLJ Language

Contents | Index |  |

## Embedded SQLJ Versus Traditional Embedded SQL Embedded SQLJ has some differences from the earlier embedded SQL languages defined by ANSI/ISO: ESQL/C, ESQL/ADA, ESQL/FORTRAN, ESQL/COBOL, and ESQL/PL/I. The major differences are as follows: The SQL connection statement of traditional embedded SQL is replaced by use of a Java connection-context object. This approach enables Embedded SQLJ programs to open multiple database connections simultaneously. In Embedded SQLJ there is no host variable definition section (preceded by a BEGIN DECLARE SECTION statement and terminated by an END DECLARE SECTION statement). All legal Java variables can be used as host variables. Embedded SQLJ does not include the WHENEVER...GOTO/ CONTINUE statement, because Java has well-developed rules for declaring and handling exceptions. Embedded SQLJ uses iterator objects rather than cursors to manage result sets. A result-set iterator is a Java object from which you can retrieve the data returned by a SELECT statement. Unlike cursors, iterator objects can be passed as parameters to methods. Embedded SQLJ supports access to data in columns of iterator objects by name, through generated accessor methods. You can also access this data by position using the FETCH...INTO statement, as used by traditional embedded SQL. Unlike other host languages, Java allows null data. Therefore, you do not need to use null indicator variables with Embedded SQLJ. Embedded SQLJ does not include dynamic SQL; you must use JDBC instead. The rest of this chapter describes how to use the Embedded SQLJ language.

IBM Informix Embedded SQLJ User's Guide, Version 1.0
Copyright © 1999, IBM Corporation. All rights reserved.