Application Building Guide


Building Java Applets and Applications

  • Setting the Environment
  • AIX
  • HP-UX
  • Linux
  • OS/2
  • PTX
  • Silicon Graphics IRIX
  • Solaris
  • Windows 32-bit Operating Systems
  • Java Sample Programs
  • JDBC Programs
  • Applets
  • Applications
  • Client Applications for Stored Procedures
  • Client Applications for User-Defined Functions
  • Stored Procedures
  • SQLJ Programs
  • Applets
  • Applications
  • Client Programs for Stored Procedures
  • Client Programs for User-Defined Functions
  • Stored Procedures
  • User-Defined Functions (UDFs)
  • General Points for DB2 Java Applets
  • You can develop Java programs to access DB2 databases with the appropriate Java Development Kit (JDK) for your platform. The JDK includes Java Database Connectivity (JDBC), a dynamic SQL API for Java.

    DB2 JDBC support is provided as part of the Java Enablement option on DB2 clients and servers. 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.

    DB2 Java embedded SQL (SQLJ) support is provided as part of the DB2 AD Client. With DB2 SQLJ support, in addition to DB2 JDBC support, you can build and run SQLJ applets and applications. These contain static SQL and use embedded SQL statements that are bound to a DB2 database.

    The SQLJ support provided by the DB2 AD Client includes:

    To run DB2 Java applications, you must install and invoke a Java Virtual Machine (JVM) that provides native threads support. To execute a Java application using native threads, you can use the -native option in your command. For example, to run the Java sample application, App.class, you can use the following command:

       java -native App
    

    You may be able to specify native threads as the default thread support for some Java Virtual Machines. The information in this chapter assumes native threads support is the default. Please refer to your JVM documentation for instructions on making native threads the default on your system.

    To run DB2 Java applets, you may invoke a Java Virtual Machine that provides either native threads or green threads support.

    For more information on DB2 programming in Java, refer to the "Programming in Java" chapter in the Application Development Guide.

    For the latest, updated DB2 Java information, visit the Web Page at:

       
    
    http://www.ibm.com/software/data/db2/java
    


    [ Top of Page | Previous Page | Next Page ]