Info |
---|
Support for ODBC was added in Profound.js 5.3.0. |
...
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.
...
- name (required): A name for the connection. The name can be whatever you choose, but must be unique.
- driver (required): Set to "odbc".
- type (required): The target database type. Can be any of "db2i", "mysql", "mssql", or "oracledb". However, this driver is primarily intended for use with DB2 for IBM i. For other databases, it's recommended to use the DB-specific drivers.
- credentialsFile: (optional): Path to a file containing an encrypted user id / password created by the "store_credentials" utility provided with Profound.js.
- driverOptions: (required): An object containing options for the odbc package's Pool constructor. See the NPM page for supported options. Profound.js's "odbc" driver only supports pooled connections. A pool is created for each databaseConnections entry.
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 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 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
Creating a Data Source on Windows
Creating a Credentials File
The example configuration above uses an encrypted credentials file. To create a credentials file, run the following command from your Profound.js installation directory and enter the desired user id and password when prompted:
Code Block |
---|
node store_credentials.js |
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 |
---|
;uid={decrypted_userid};pwd=${decrypted_password}; |
When using this option, specify the "connectionString" without the "uid" and "pwd" options.