1
votes

In order to use db2 with node.js on my mac. I have installed the db2 drivers - DB2 v11.1.4.5.

I also configured my environment paths so that the correct config files will be used by unixODBC I configured the odbcinst.ini, ODBC.ini , db2cli.ini, and the db2dsdriver.cfg files

The issue is that I get the error below when I run the iqsl command or the db2cli validate command

My Error

[S1000][unixODBC][IBM][CLI Driver] SQL10007N Message "0" could not be retrieved.  Reason code: "3".

unixODBC isql command syntax

isql usrProd userid password

db2cli validate command syntax

db2cli validate -dsn alias -connect -user userid -passwd password

Environment path stored in file ~/.bash_profile

export PATH=$PATH:/usr/local/share/odbc_db2/clidriver/bin/
export DB2CLIINIPATH=/usr/local/share/odbc_db2/clidriver/cfg/
export DB2DSDRIVER_CFG_PATH=/usr/local/share/odbc_db2/clidriver/cfg/

I have been documenting the steps that I took to install the db2 command line drivers.

My documentation

locations of the IBM DB2 Drivers I have installed:

Client Version (level/bit): DB2 v11.1.4.5 (special_39510/64-bit)


Client Version (level/bit): DB2 v11.1.1.1 (s1703232000/64-bit)

UPDATE --- 20200413----

I got it to work on my Mac. I did get it to work with Node.js

I contacted a few IBM developers who are working directly on this project, and they gave me access to the proper "IBM i Access ODBC Driver" to connect to the as400 from the mac. It is being beta tested now. At some point, it should be released. to the general public.

db2cli drivers are not needed, db2cli.ini is not needed:

IBM has specific odbc drivers for the iseries. I dont have permission to share the drivers with the public, but do know that it will be possible soon for everyone to connect to db2 installed on the iseries

2
If you want to connect directly via ODBC to Db2-for-i on MAC OSX, you can only do that currently if you have installed-and-licensed a separate "Db2 Connect" gateway server. The reason is that the driver you chose is only for connecting to Db2-on-Linux/Unix/Windows, or via a Db2-connect gateway to i-series or Z/OS. IBM currently offers ODBC/.NET/OLE DB/XDA connectivity (which does the protocol conversion without needing a gateway) to i-series via IBM i access solutions only on Linux or Microsoft-Windows. So, retry on Linux/Windows or connect indirectly via a Db2-connect gateway.mao
Looks like you might also need to set the library locationmustaccio
I made the suggested change and It did not help DYLD_LIBRARY_PATH=/usr/local/lib/:/usr/local/share/odbc_db2/clidriver/lib/moyarich

2 Answers

0
votes

I got it to work on my Mac and I did get it to work with Node.js

I contacted a few IBM developers who are working directly on this project, and they gave me access to the proper "IBM i Access ODBC Driver" to connect to the as400 from the mac. It is being beta tested now, i assume that at some point, it should be released to the general public.

Note : db2cli drivers are not needed, db2cli.ini is not needed, and setting environment paths are not needed:

IBM has specific odbc drivers for the iseries. I don't have permission to share the drivers with the public, but do know that it will be possible soon for everyone to connect to db2 installed on the iseries

0
votes

For IBM DB2 Warehouse on the IBM CLoud you can go to this url https://your_tenant.cloud.ibm.com/console/#connection/overview

In above replace your_tenant with your tenant id.enter image description here