IBM Books

Quick Beginnings for DB2 Extended Enterprise Edition for UNIX


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. You can run JDBC applets inside HTML (Hypertext Markup Language) web pages 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 applets.

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

Figure 5. Accessing Internet Data Stored on DB2 Using JDBC


Diagram showing clients using a Web browser to connect to DB2 Universal Database.

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

For more information on Java enablement, refer to the IBM Software Page under the Data Management link (http://www.software.ibm.com/data/db2/java/). For more information on the JDBC API, refer to the URL 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 document and, when selected, they trigger existing SQL queries and return the results from a DB2 database. These links can be triggered repeatedly to access current DB2 data. Customized queries require user input. Users define the search characteristics 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 a DB2 server to allow local access to databases. Net.Data can be installed with a DB2 Client Application Enabler to allow remote access to databases. In both cases, Net.Data and a web server must be installed on the same system. See Figure 6 for an example of Net.Data that is being used to access data from remote DB2 databases.

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


Diagram showing clients using a Web browser to connect to DB2 Universal Database.


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

[ DB2 List of Books | Search the DB2 Books ]