IBM Books

Quick Beginnings


Accessing DB2 Data from the Web

The popularity of the Internet and the World Wide Web has created a demand for Web access to enterprise data. Java Database Connectivity (JDBC) and Net.Data are provided with DB2 to allow you to create applications that access data in DB2 databases.

Use Java Database Connectivity to create applications or applets that access data in DB2 databases. JDBC applets can be run inside HTML web pages on any system with a Java-enabled browser, regardless of the platform of your client. No additional software is required on your client system beyond this browser. The processing of JDBC applets is shared between the client and the server.

The JDBC server and the DB2 Client Application Enabler must reside on the same machine as the Web server. The JDBC server calls into the DB2 Client Application Enabler to connect to local or remote databases, or into MVS/ESA to connect to host databases. When a connection to a DB2 database is requested by the applet, the JDBC client opens a TCP/IP socket to the JDBC server on the machine where the Web server is running. See Figure 2 for an example of Java-enabled browsers accessing data from DB2 databases remotely.

Figure 2. Accessing Internet Data Stored on DB2 Using JDBC


* Figure sqlr1jdb not displayed.

JDBC applications can be run from any system that has the DB2 Client Application Enabler software installed: a Web browser and a Web server are not required.

For more information on Java enablement, see the IBM Software Page under the Data Management link (http://www.software.ibm.com/data/db2/java). For more information on the JDBC API, see http://splash.javasoft.com.

Use Net.Data to create applications that are stored on a Web server and viewable from any Web browser. While viewing these documents, users can either select automated queries or define new ones that retrieve the specified information directly from a DB2 database.

Automated queries do not require user input; they are links in the HTML (hypertext markup language) document and, when selected, they trigger existing SQL queries and return the results from the DB2 database. These links can be triggered repeatedly to access current DB2 data. Customized queries require user input. Users define the search criteria on the Web page by selecting options from a list or by typing values in the entry fields. They submit the search by clicking on a push button. Net.Data uses the information that is supplied by the user to dynamically build a complete SQL statement and it sends the query to the database.

A demonstration of Net.Data applications is available from the IBM Software Page (http://www.software.ibm.com) under the Data Management link.

Net.Data can be installed with the server, DB2 Universal Database, to allow local access to databases. Net.Data can be installed with DB2 Client Application Enabler software to allow remote access to databases. In both cases, Net.Data and a Web Server must be installed on the same system. See Figure 3 for an example of Net.Data accessing data from DB2 databases remotely.

Figure 3. Accessing Internet Data Stored on DB2 Using Net.Data


* Figure sqlr1www not displayed.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]