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.

...

  • Increased performance, both for connections to a remote IBM i and for connections on from IBM i to the local database.
  • Connections to multiple IBM i systems are supported. The "IBMi" driver only supports connecting to a single IBM i system.
  • Nothing needs to be installed on target IBM i systems. The "IBMi" driver requires a Profound.js installation on the target IBM i system.

...

The "odbc" driver does not allow non-SQL APIs (such as for program/procedure call, CL command, etc.) to run against the target system.

Installation

The "odbc" driver utilizes 3 different components that need to be installed on the 'source' system only. Meaning, the system where you are running Profound.js and want to connect to IBM i.

...

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": "DSNsystem=myIBMi;nam=1;cmt=0;unicodesql=1;tsft=1;dbq=,mylibMYLIB,mylib2MYLIB2,mylib3;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 (;). See . Option names are not case-sensitive. See here for options supported by the IBM i Access ODBC driver:

https://www.ibm.com/docs/en/i/7.4?topic=details-connection-string-keywords

Driver options can be specified directly, or alternatively via an ODBC Data Source. A Data Source is an OS-specific location (such as a file) where ODBC settings are stored. To use a Data Source, reference the name using the DSN (Data Source Name) property.

It's also possible to use a combination of these approaches – properties specified directly in "connectionString" will override the settings from a Data Source. For example, in the above configuration a Data Source named "myIBMi" is used, and the library list is overridden set to "MYLIB , MYLIB2 , MYLIB3" .

It's recommended to use a Data Source configured with the following options:

Code Block
Driver           = IBM i Access ODBC Driver
System           = ibmi_hostname_or_ip
Naming           = 1
CommitMode       = 0
UnicodeSQL       = 1
TimestampFormat  = 1

If connecting to IBM i from outside the private network, it's recommended to enable SSL with this setting:

Code Block
SSL = 1

The process of creating a Data Source depends on the source operating system. 

Creating a Data Source on Linux, Mac, and IBM i

...

with no default schema, using the "dbq" connecting string option, and commitment control is disabled via the "cmt" option. The following settings are required by Profound.js and should be set on all connections:

OptionRequired Value
nam1
unicodesql1
tsft1

Creating a Credentials File

...

Code Block
;uid={decrypted_userid};pwd=${decrypted_password};

When using this option, specify the "connectionString" without the "uid" and "pwd" options.

Using ODBC Data Sources

An ODBC Data Source is an alternative way of specifying ODBC connection options. A Data Source is an OS-dependent location (such as a file) where ODBC connection options are stored. When using a Data Source, you can simply specify the Data Source Name (DSN) in the "connectionString", and the options are loaded from the Data Source.

The process of creating a Data Source depends on the source operating system.

Creating a Data Source on Linux, Mac, and IBM i


Creating a Data Source on Windows