Accessing DB2 host data from the web using Java
DB2 Connect™ products include the IBM® DB2® Driver for JDBC and SQLJ to allow you to create applications that access data in DB2 databases from the Web.
Programming languages containing embedded SQL are called host languages. Java™ differs from the traditional host languages C, COBOL, and FORTRAN, in ways that significantly affect how it embeds SQL:
- SQLJ and JDBC are open standards, enabling you to easily port SQLJ or JDBC applications from other standards-compliant database systems to the DB2 database.
- All Java types representing composite data, and data of varying sizes, have a distinguished value, null, which can be used to represent the SQL NULL state, giving Java programs an alternative to NULL indicators that are a fixture of other host languages.
- Java is designed to support programs that, by nature, are heterogeneously portable (also called "super portable" or simply "downloadable"). Along with Java's type system of classes and interfaces, this feature enables component software. In particular, an SQLJ translator written in Java can call components that are specialized by database vendors in order to leverage existing database functions such as authorization, schema checking, type checking, transactional, and recovery capabilities, and to generate code optimized for specific databases.
- Java is designed for binary portability in heterogeneous networks, which promises to enable binary portability for database applications that use static SQL.
- You can run JDBC applets inside a web page on any system with a Java-enabled browser, regardless of the platform of your client. Your client system requires no additional software beyond this browser. The client and the server share the processing of JDBC and SQLJ applets and applications.
Figure 1. JDBC and DB2 Connect
JDBC and SQLJ applications can be run from any system that has a IBM data server client installed;
a Web browser and a Web server are not required.
For more information on the JDBC API, see the http://java.sun.com/products/jdbc/ web page.
Parent topic: DB2 Connect
Related concepts
Supported drivers for JDBC and SQLJ