DB2 Version 10.1 for Linux, UNIX, and Windows

Installing the node-ibm_db driver on Linux and UNIX systems

You can install the node-ibm_db driver on Linux and UNIX systems for use with Node.js applications.

Before you begin

You must install the IBM® Data Server Driver Package product on the system where you are installing or running the Node.js application:

Procedure

To install the node-ibm_db driver:

  1. Set the IBM_DB_HOME environment variable to your IBM data server product installation directory by issuing the following command:
    export IBM_DB_HOME=DB2HOME
    where DB2HOME is the directory where the IBM Data Server Driver Package product is installed. For example, if the client package is installed in the /home/db2inst1/dsdriver directory, issue the following command:
    export IBM_DB_HOME=/home/db2inst1/dsdriver
  2. Issue the npm install command:
    npm install ibm_db

What to do next

Before you run any Node.js application that connects to an IBM database server, you must ensure that the node-ibm_db driver can access the CLI driver by sourcing the db2profile script. The script is in the IBM Data Server Driver Package product installation directory. To source the script, issue the following command:
source DB2HOME/db2profile