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.
...
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. Connection options can also be specified on the "connectionString" along with the DSN. In this case, the options override those 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
On these systems, Data Sources are stored in a text file named "odbc.ini". The file location depends on the OS, but is typically /etc/odbc.ini. On IBM i, the location is /QOpenSys/odbc.ini. The file can be edited directly, but it's recommended to use the odbcinst command-line utility to add/remove data sources. On IBM i, the odbcinst command can be run in a PASE shell.
To add a data source, create a file named "template.ini" anywhere on the file system and copy/paste the following lines into the file:
Code Block |
---|
[myIBMi]
Driver=IBM i Access ODBC Driver
System=localhost
Naming=1
CommitMode=0
UnicodeSQL=1
TimestampFormat=1 |
Make the following adjustments to the file:
- The text 'myIBMi' inside the square brackets specifies the Data Source Name. Adding the Data Source will replace an existing Data Source of the same name. Change the 'myIBMi' text to the desired name, leaving the square brackets in place. To check existing DSNs, you can use this command:
Code Block |
---|
odbcinst -q -s |
- If connecting from off system to IBM i, change the value of the 'System' property to the host name or IP address of the target IBM i system. Otherwise, leave as localhost.
Other options can be added to the file as desired. When the "template.ini" file is ready, use this command to add the Data Source:
Code Block |
---|
odbcinst -i -s -l -f template.ini |
If the command completes successfully, the DSN is added to the "odbc.ini" file. This command can be used to confirm:
Code Block |
---|
odbcinst -q -s -n DATA_SOURCE_NAME |
The Data Source configuration should be output to the screen. At this point, the "template.ini" file is no longer necessary and can be removed.
The Data Source Name can now be referenced in the "connectionString" like this:
Code Block | ||
---|---|---|
| ||
"databaseConnections": [
{
"name": "myIBMi",
"driver": "odbc",
"type": "db2i",
"credentialsFile": `${__dirname}/credentials`,
"driverOptions": {
"connectionString": "DSN=DATA_SOURCE_NAME;dbq=,DATALIB1,DATALIB2",
}
}
] |
Creating a Data Source on Windows
...