. Updated Daily. Editions SDA India   SDA Indonesia
BUSINESS ENTERPRISE SOLUTIONS ARCHITECTURE INFORMATION SECURITY WIRELESS & MOBILITY DATA & STORAGE DEVELOPMENT HARDWARE













News

Wednesday, 31 January 2007

Article: Use Xajax, AJAX with PHP and DB2 9

 

 

Deepak Vohra at the IBM web site has posted an article on how to implement PHP, AJAX, and Xajax to develop a dynamic Web application solution accessing IBM, DB2 9 for Linux, UNIX and Windows. For the unacquainted, Xajax is an open source, object-oriented, PHP class library.

Deepak starts the tutorial with the process of installing the products and creating a database. He divides the article into the following heads:

Install DB2 for Linux, UNIX, and Windows

He says, the PHP extension for DB2 database may be used with DB2 for Linux, UNIX, and Windows V8.2 or later. He points out the installation instructions used for DB2 Enterprise 9 for Windows. After the installation he goes through the step of creating a sample database.

Install PHP and Xajax

As Xajax is a PHP class library, first download and install PHP 5, he says. PHP 5 may be installed on a number of different Web servers. This article discusses configuring PHP 5 with the Apache Web server on Windows he informs. He steps you through the installing and configuring of PHP.

Create a DB2 database table

The Xajax application retrieves data from a DB2 database table. The database table may be created with a PHP script he says. He shows how to create a PHP script and createTable.php with the help of listings and examples. Even he shows how to define variables for user and password.

Sending a request

Next he develops an example application comprising of an input form. The input form takes data to add a catalog entry to a database table Catalog. As a user begins to enter data in the input field Catalog Id, a XMLHttpRequest HTTP request is sent to the server to validate the Catalog Id value added. If the Catalog Id is not already defined in the database, a message ‘Catalog Id is Valid’ is displayed. If the Catalog Id is already defined in the database, a message ‘Catalog Id is not Valid’ is displayed, the Create Catalog button is disabled, and field values for the Catalog Id are added to the form, he verifies.

Processing a request

He says that Xajax provides the xajaxResponse class to send a response to the client application. He explains this by a table where he lists the xajaxResponse Command Messages, a listing consisting of the input.php data and figures showing the input form, validating input field, adding valid input field value and such.

 

Read the Article

 
 
print save email comment

print

save

email

comment

 
 

Search SDA Asia

Free eNewsletter

SDA Asia Magazine Free Download
 
 
 
Copyright @ 2008 SDA Asia Magazine - All Right Reserved Privacy Policy | Terms of Use