Java Support (JDBC), Embedded SQL for Java (SQLJ), and Net.Data are provided with DB2 to allow you to create applications that access data in DB2 databases from the Web.
Use Java Support to create applications or applets that access data in DB2 databases. You can run JDBC applets inside Hypertext Markup Language (HTML) 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 and applications.
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
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 Java Enablement web page (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 entering 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. Access the Data Management Link from the option on the Products drop-down window.
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