Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



Info

Support for ODBC was added in Profound.js 5.3.0.

...

The "odbc" driver can be used to run SQL statements against DB2 for i using the following APIs:

...

  • The Profound.js "odbc" driver. This component is built into Profound.js, starting with version 5.3.0 and relies on the following components for connectivity to the target system.
  • The open source package odbc, which must be installed separately via NPM. This package provides a Node.js interface for using ODBC drivers.
  • The ODBC driver for the target system. This package performs the actual work of communicating with the target database. For example, ODBC access to IBM i is provided by the IBM i Access ODBC Driver, which is supplied by IBM.

...

An IBM account is required to access the downloads. Click on Downloads for IBM i Access Client Solutions, accept the license agreement, and use the ACS App Pkg link for the appropriate source operating system. For IBM i, use ACS PASE App Pkg. Installation instructions are included in each download package.

The IBM i version of the Application package installs via the open-source package manager "yum". See here for instructions on setting up yum on IBM i:

https://www.ibm.com/support/pages/node/706903

For Application Package installers for 32-bit Windows or languages other than English, visit the IBM ESS Website

...

Code Block
languagejs
"databaseConnections": [
  {
    "name": "myIBMi",
    "driver": "odbc",
    "type": "db2i",
    "credentialsFile": `${__dirname}/credentials`,
    "driverOptions": {
      "connectionString": "driverDRIVER=IBM i Access ODBC Driver;systemSYSTEM=myIBMi;namNAM=1;cmtCMT=0;unicodesqlUNICODESQL=1;tsftTSFT=1;dbqDBQ=,MYLIB,MYLIB2,MYLIB3",
      "initialSize": 10,
      "maxSize": 10,
      "shrink": false
    }
  }
]

...

ODBC driver options (such as what system to connect to, etc.) are configured using the "connectionString" property of the "driverOptions" object. Option names/values are separated by an equal sign (=) and each name/value pair is separated by a semi-colon (;). Option names are not case-sensitivemust be specified in uppercase. See here for options supported by the IBM i Access ODBC driver:

...

For example, in the above configuration the library list is set to "MYLIB MYLIB2 MYLIB3" with no default schema, using the "dbqDBQ" connecting string option, and commitment control is disabled via the "cmtCMT" option. The following settings are required by Profound.js and should be set on all connections:

OptionRequired Value
namNAM1
unicodesqlUNICODESQL1
tsftTSFT1

Creating a Credentials File

...

The credentials file is decrypted when the Profound.js server starts, and the user id and password are appended to the end of the "connectionString" like this:

Code Block
;uidUID={decrypted_userid};pwdPWD={decrypted_password};

When using this option, specify the "connectionString" without the "uidUID" and "pwdPWD" options.

Using ODBC Data Sources (optional)

...

Code Block
languagejs
"databaseConnections": [
  {
    "name": "myIBMi",
    "driver": "odbc",
    "type": "db2i",
    "credentialsFile": `${__dirname}/credentials`,
    "driverOptions": {
      "connectionString": "DSN=DATA_SOURCE_NAME;dbqDBQ=,DATALIB1,DATALIB2",
    }
  }
]

...

Code Block
"databaseConnections": [
  {
    "name": "myIBMi",
    "driver": "odbc",
    "type": "db2i",
    "credentialsFile": `${__dirname}/credentials`,
    "driverOptions": {
      "connectionString": "FILEDSN=DATA_SOURCE_NAME;dbqDBQ=,DATALIB1,DATALIB2",
    }
  }
]

...

Code Block
"driverOptions": {
  "connectionString": "DSN=myIBMi;",
  "initialSize": 10,
  "maxSize": 20,
  "incrementSize": 2,
  "shrink": false
}

Tuning IBM i Server Jobs

...