IBM GC09-2830-00 Server User Manual


 
Running Java Programs
You can develop Java programs to access DB2 databases with the appropriate
Java Development Kit (JDK) on AIX, HP-UX, Linux, OS/2, Silicon Graphics
IRIX, Solaris, or Windows 32-bit operating systems. The JDK includes Java
Database Connectivity (JDBC), a dynamic SQL API for Java.
For DB2 JDBC support, you must include the DB2 Java Enablement
component when you install the DB2 client. With DB2 JDBC 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 the DB2 database.
Java can also be used on the server to create JDBC and SQLJ stored
procedures and user-defined functions (UDFs).
Building and running different types of Java programs requires support from
different components of DB2:
v To build JDBC applications, you must install a DB2 client with the DB2 Java
Enablement component. To run JDBC applications, your DB2 client with the
DB2 Java Enablement component must connect to a DB2 server.
v To build SQLJ applications, you must install the DB2 SDK and a DB2
Administrative Client with the DB2 Java Enablement component. To run
SQLJ applications, your DB2 client with the DB2 Java Enablement
component must connect to a DB2 server.
v To build JDBC applets, you must install a DB2 client with the DB2 Java
Enablement component. To run JDBC applets, the client machine does not
require any DB2 components.
v To build SQLJ applets, you must install the DB2 SDK and a DB2
Administrative Client with the DB2 Java Enablement component. To run
SQLJ applets, the client machine does not require any DB2 components.
For detailed information on building and running JDBC and SQLJ programs
see Application Building Guide. For more information on DB2 programming in
Java, refer to the Application Development Guide. This covers creating and
running JDBC and SQLJ applications, applets, stored procedures and UDFs.
For the latest, updated DB2 Java information, visit the Web Page at:
http://www.software.ibm.com/data/db2/java
Chapter 10. Running Your Own Applications 127