DB 2 ODBC
(click to open)
Quick Page Table of Contents
Scanning…
ODBC client access only …
Who is this page for?
Instructions designed for IBM i developer learning PHP starting from ground zero …
- … installing PHP on a laptop
- … little control over IBM i machine (can’t install Zend Server on IBM i)
- … but have a Client Access ODBC connection to IBM i (good enough)
Prerequisites
On IBM i …
- recent IBM i {DB2 PTFs} or clobs will fail (PHP ODBC drivers)
On laptop …
- {iAccess ODBC} connection to IBM i (Client Access ODBC)
- {Zend Download site} - Zend Server Community Edition
Check your odbc configuration
Walk before we run … check if client access ODBC is working from command line.
Q: How do I test my odbc connection? A: use odbc tool isql >isql myibmi MYID MYPASSWORD
If isql is working there is a good chance that PHP odbc will be working.
<?php $conn = odbc_connect("myibmi","MYUID","MYPWD"); ?>
odbc configuration (if you need help)
If you need iAccess drivers DBC instructions {Linux ODBC}.
odbc running on IBM i
Most IBM i configurations will already have ODBC running for various other iAccess products, but if you need STRHOSTSVR SERVER(*DATABASE) is the command to start the ODBC IBM i server.
Run to IBM i
On your laptop create these files for testing via Zend Studio (or Apache, or command line)..
- download (click to download)
- Common files (click to view)
- lugconnect.php - connection to IBM i (odbc.ini)
- lugencrypt.php - encrypt/decrypt password
- A test (click to view)
- lug1stodbc.php - using PHP odbc
Author(s)
Tony “Ranger” Cairns - IBM i PHP / PASE