Building Applications for UNIX** Environments
You can develop Java programs to access DB2 databases with the appropriate
Java Development Kit (JDK) on AIX, HP-UX, SCO UnixWare 7, Silicon Graphics
IRIX, or Solaris. The JDK includes Java Database Connectivity (JDBC), a
dynamic SQL API for Java.
DB2 JDBC support is provided by the DB2 Client Application Enabler (DB2
CAE). With this support you can build and run JDBC applications and
applets. These contain dynamic SQL only, and use a Java call interface
to pass SQL statements to DB2.
The DB2 Software Developer's Kit (DB2 SDK) provides support for Java
embedded SQL (SQLJ). With DB2 SQLJ support and DB2 JDBC support you can
build and run SQLJ applications and applets. These contain static SQL
and use embedded SQL statements that are bound to a DB2 database.
The SQLJ support provided by the DB2 SDK includes:
- The DB2 SQLJ translator, sqlj, which replaces embedded SQL
statements in the SQLJ program with Java source statements, and generates a
serialized profile which contains information about the SQL operations found
in the SQLJ program. The SQLJ translator uses the
sqllib/java/sqlj.zip file.
- The DB2 SQLJ profile customizer, db2profc, which precompiles
the SQL statements stored in the generated profile, customizing them into
calls to the SQLJ runtime function, and generates a package in the DB2
database. For more information on the db2profc command, see
the Command Reference.
- The DB2 SQLJ runtime function, which provides a runtime interface to the
DB2 database manager. It uses the
sqllib/java/runtime.zip file.
Building and running different types of Java programs requires support from
different components of DB2:
- To build JDBC applications requires the DB2 Client Application Enabler
(DB2 CAE). To run JDBC applications requires the DB2 CAE in order to
connect to DB2.
- To build SQLJ applications requires the DB2 CAE and the DB2 SDK. To
run SQLJ applications requires the DB2 CAE in order to connect to DB2.
- To build JDBC applets requires the DB2 CAE. No DB2 component is
required to run JDBC applets on a client machine.
- To build SQLJ applets requires the DB2 CAE and the DB2 SDK. No DB2
component is required to run SQLJ applets on a client machine.
For more information on DB2 programming in Java, refer to the Embedded SQL Programming Guide, chapter 15, "Programming in Java". This covers creating and
running JDBC applications, applets, stored procedures and UDFs.
Information on SQLJ applications, applets, stored procedures and UDFs can be
found in the What's New book.
For the latest, updated DB2 Java information, visit the Web Page at
http://www.software.ibm.com/data/db2/java.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
[ DB2 List of Books |
Search the DB2 Books ]