Introduction: Hypertext Processor (hypertext processor,php) is a scripting language for building open source code for WEB pages. With PHP and open database connections (open DB CONNECTIVITY,ODBC), you can dynamically generate WEB pages from data stored in ibm®cloudscape™ and Apache Derby databases. This article will determine how to install and configure PHP on Windows®. At the same time, understand the PHP scripting language by learning how to connect to the Derby database and insert data and query data.
Overview
PHP is a general-purpose scripting language for open source code that can be embedded in HTML for Web development. IBM Cloudscape is the commercial version of the Apache Derby open source database.
Isn't it great to use PHP to dynamically build WEB pages from data stored in a Derby database? ODBC provides an intermediate link so that you can complete the work accurately. PHP supports ODBC, while IBM DB2®ODBC drivers can be used to access the Derby database. This technical article shows you how to connect those three. This article first explains how to configure the IBM DB2 ODBC driver to use Derby, then shows you how to install PHP on Windows and configure the WEB server, and finally gives you the PHP sample code to execute the SQL statements in the Derby database.
Software Requirements
The software described in this section is available for free download.
Install one of the following database options:
Cloudscape 10.0 (including IBM DB2 JDBC Universal Driver)
Apache Derby and IBM DB2 JDBC Universal Driver
In addition, install all of the following software:
The instructions in this technical article in PHP are tested using PHP version 4.3.29 and 5.0.2, and we recommend the use of version 4.3.29.
IBM DB2 ODBC
Web server. The instructions in this technical article are based on the Apache HTTP Server 2.0.50 test. In addition, they should also take effect for IBM HTTP Server 2.0.
Configuring IBM DB2 ODBC Clients
To use the IBM DB2 ODBC driver and Derby database, the IBM DB2 client software needs to know where the Derby database resides and what its name is, and also needs to know that it is an ODBC data source. This section shows you how to catalog the node to provide all of this information.