× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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.


DATABASE=;HOSTNAME=hostname;UID=username;PWD=password;

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 = '10.1.1.10';
$port = 446;
$driver = "{iSeries Access ODBC Driver}";

$conn_string = "DRIVER=$driver;" .
"PWD=$pass;" .
"HOSTNAME=$hostname;" .
"PORT=$port;" .
"UID=$user;" .
"CommitMode=0;" .
"DATABASE=$database;" .
"Naming=0;";
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 ...

Replies:

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

This mailing list archive is Copyright 1997-2024 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.