Tutorial: Connecting to an IMS Database

Goal

Create and verify an IMS database connection.

Prerequisites

IMS must be configured with ODBM and IMS Connect. See Prerequisites for more information.

Steps

  1. In the IMS Connections view, click the Add IMS Connection(s) button.
  2. Click Add IMS DB Connection.
  3. Specify a name for the new database connection.
  4. The ims.connections.json project file opens and the following database connection contents are added to the profile. Save your file changes.

Note: Ensure to replace placeholder information such as yourIMShostname and yourPSBname with your intended connection details.

{
  "profiles": {
    "imsdb": {
      "databaseConnectionName": {
        "dataStoreServer": "yourIMShostname.com",
        "portNumber": 5555,
        "databaseName": "yourPSBname",
        "fetchsize": 100,
        "maxrows": 500,
        "autocommit": false
      }
    }
  },
  "autoStore": true
}
  1. Use the IMS Connection button in the status bar to verify or switch the active target IMS database connection.
  2. Once connected, your database connection icon changes to green to indicate successful connection. DBDs and PSBs are available in the tree view by clicking the drilldown option next to the database connection.

Result

Your connection is ready for use to browse an IMS database and execute SQL.


Optional: Setting up multi-factor authentication (MFA)

If your IMS system requires multi-factor authentication (MFA) or time-based one-time passwords (TOTP), no additional configuration is needed in ims.connections.json. IMS Explorer for VS Code detects the MFA requirement at connection time and prompts you for a token.

The following example shows a typical MFA-enabled connection profile. It is identical to a standard connection — the MFA prompt is triggered automatically by the server.

{
  "profiles": {
    "imsdb": {
      "mfaDatabaseConnection": {
        "dataStoreServer": "yourIMShostname.com",
        "portNumber": 5555,
        "databaseName": "yourPSBname",
        "fetchsize": 100,
        "maxrows": 500,
        "autocommit": false
      }
    }
  },
  "autoStore": true
}

When you connect:

  1. IMS Explorer detects that MFA or TOTP is required.
  2. A prompt appears asking you to enter your MFA or TOTP token.
  3. After the token is validated, the connection is established.

If authentication fails, a Quick Pick option is provided to re-enter your credentials without restarting the connection flow.

For more information about MFA connection behavior, see Creating IMS connections.