On 11/10/2015 1:43 PM, Justin Dearing wrote:
On Tue, Nov 10, 2015 at 10:51 AM Buck Calabro <kc2hiz@xxxxxxxxx> wrote:

There isn't one, single DB2. There are three of them:
DB2 for z (mainframe)
DB2 for LUW (Linux, Unix, Windows)
DB2 for i (that's us!)

Each one needs a different ODBC driver. The ODBC driver for DB2 for i
comes with IBM Access for Windows, and there's an equivalent in the
Access Client Solutions package as well.

Ok, but PHP is absracting this away. There is one ibm_db2 driver with one
db2_connect call for all the DB2 flavors and apache derby.

And so: What's your entire
connexion string? Are you using the DB2 LUW driver to try to talk to
IBM i? That might work, but DB2 for i has a different port. 446 if
memory serves.


My Current puzzle is if I'm running process monitor on php, even if the
AS/400 uses a different port number, I should see a failed TCP connection
if I change the hostname of a working connection string from localhost to
another hostname.

Here's a snippet from something I started on some time ago. As I said,
I can't test it at the moment, so...

$database = 'rdb_dire';
$user = 'user_profile';
$pass = 'password';
$hostname = '';
$port = 446;
$driver = "{iSeries Access ODBC Driver}";

$conn_string = "DRIVER=$driver;" .
"PWD=$pass;" .
"HOSTNAME=$hostname;" .
"PORT=$port;" .
"UID=$user;" .
"CommitMode=0;" .
"DATABASE=$database;" .
echo $conn_string;

$conn = db2_connect($conn_string, $user, $pass);
$err = db2_conn_errormsg();
echo $err;

Do a WRKRDBDIRE to find out the database name of the machine.
Naming 0 = SQL
CommitMode 0 = NC

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.