Connecting a PHP application to Apache Derby

Source: Internet
Author: User
Tags install php ibm db2 ibm db2 odbc driver install php on windows connect odbc php and php sample code

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.