SQL/MX Programming Manual for Java

HP NonStop SQL/MX Programming Manual for Java523726-003
1-1
1 Introduction
This manual explains how to develop Java applications that contain embedded SQL
statements, otherwise known as SQLJ programs, for the NonStop SQL/MX
environment.
This section covers these topics:
What Is SQLJ?
Benefits of SQLJ
SQLJ and JDBC Interoperability
SQLJ Versus JDBC Performance
Steps of Developing and Executing an SQLJ Program
Processing an SQLJ Program
Executing an SQLJ Program
What Is SQLJ?
SQLJ is part of the SQLJ Part 0 standard and has been incorporated into the ANSI
SQL:2003 standard as the International Standard Database Language SQL—Part 10:
Object Language Bindings (SQL/OLB) specification. The standard provides constructs
for embedding SQL statements in Java programs. This manual describes the
NonStop SQL/MX implementation of SQLJ Part 0 and refers to SQLJ Part 0 as simply
SQLJ.
Use SQLJ to embed static SQL statements directly in a Java program in much the
same way that you embed SQL statements in a C or COBOL program. An SQLJ
program supports static SQL statements in a Java program and yields the performance
benefits of statically compiled SQL in a portable application.
In SQL/MX, an SQLJ program uses embedded SQL/MX statements to access an
SQL/MP database and/or an SQL/MX database. You cannot embed SQL/MP
statements in an SQLJ program. However, you can use SQL/MX statements to query
SQL/MP database objects. For more information, see Name Resolution on page 4-20.
Benefits of SQLJ
Support for statically compiled SQL statements in addition to dynamically executed
SQL statements in JDBC
Easier coding because of concise syntax and similar look and feel to static SQL in
C or COBOL
Note. HP NonStop SQL/MX SQLJ (product T1232) has reached MATURE support status,
meaning that requests for enhancements (RFEs) are not considered and that only critical
defects are repaired. To develop Java applications that access NonStop SQL/MP and SQL/MX
databases, use JDBC instead of SQLJ. For more information, see the JDBC Driver for
SQL/MX Programmer’s Reference.