DEV Community

How to connect Node.js to IBM DB2 database - windows

Moya Richards on February 20, 2020

It is good to connect with the right people. For months now I thought that we had to pay over 30k for the license to use DB2 with node. Today I con...
Collapse
 
bimalkjha profile image
Bimal Kumar Jha • Edited

To connect a Db2 for z/OS, Db2 for AS400, Db2 for LUW or Db2 on Cloud/Dashdb or bigsql server using node.js application, you just need to install ibm_db package.

npm install ibm_db

and you are ready to go. You can install ibm_db on MacOS, Windows, Linux, zLinux, AIX, Sun, Sunamd, Linuxppc and z/OS platforms.
Check it for more info: github.com/ibmdb/node-ibm_db

Collapse
 
bskimball profile image
Brian Kimball

What about the DB2Connect licensing mentioned in the readme? I think that was the point of using the odbc connection instead

Collapse
 
michelc profile image
Michel

That sounds pretty good. Did you use the "odbc" package on Windows? Because I am currently connecting to DB2 with ODBC from a WinForm client, and with Node I could try to automate some queries.

Collapse
 
moyarich profile image
Moya Richards • Edited

Ohh I sure did:

this is a github link with a massive amount of mocha test cases that you can use to practice how to run queries using node: github.com/markdirish/node-odbc-ac...

odbc datasource

Collapse
 
obito profile image
obito

Can u tell me or post the link which where should u download the iSeries Access ODBC Driver ?