IBM Db2
Let agents query an IBM Db2 database, on IBM Cloud or your own server.
Connect it with: Connection details. IBM Db2's own documentation: https://cloud.ibm.com/docs/Db2onCloud?topic=Db2onCloud-getting-started.
What agents can do
Connect IBM Db2 so the agents working your tasks can reach it. With it connected, they can:
- Run SQL against Db2 tables to answer a question or check data a bug left behind.
- Read the system catalog (SYSCAT views) to see tables, columns and indexes before changing a schema.
- Export a query result to CSV and attach it to the task.
Before you start
- A Db2 on Cloud instance, or a Db2 server reachable from the internet over SSL.
- A service credential (Db2 on Cloud) or a database user for agents, granted only the tables they need.
- A Db2 client where the agent runs, such as the ibm_db Python package.
- A Jaah account. Anyone can add a personal secret; an organization secret needs an Org Owner or Admin.
Connect with IBM Db2
Jaah connects to IBM Db2 with connection details, not with a sign-in button.
Connect with an API key
Find each value first:
- Host: IBM Cloud: Resource list > your Db2 instance > Service credentials > New credential > Add, then expand it and copy hostname. Your own server: its public host name.
- Port: The port from the same service credential (port). Db2 on Cloud accepts SSL connections only, on that port.
- Database: The database name from the service credential (database); Db2 on Cloud's is bludb.
- User: The username from the service credential, or the database user created for agents.
- Password: The password from the same service credential.
Then add it to Jaah:
- In Jaah, open Secrets, select New, and pick the IBM Db2 card.
- Name the secret and choose who can use it.
- Fill in Host, Port, Database, User, Password.
- Select Save. Jaah tests the secret straight away (see Test the connection).
Jaah encrypts what you type and never shows it again — not to you, and not to an admin.
Use your own OAuth app
Not used: Jaah connects to IBM Db2 with connection details, not through an OAuth app.
Test the connection
Select Test on the secret. Jaah checks that each value has the right shape, but does not call IBM Db2: the result reads Format checked — IBM Db2 was not called. The first real check is when an agent uses it.
Who can use it
Every secret has an owner, and the owner decides who can use it:
- Personal — only your own tasks can use it. This is the default.
- Organization — every task in the organization can use it. Only Org Owners and Admins can choose this.
- Attached to a project — every task on that project can use it, whoever started the task. See Attach a secret to a project.
More on owners and access: How secrets work.
Use it in an agent session
An agent asks for the secret with its credential_get tool, by the secret's path, when it needs it, and gets the values for that one call. The path is the owner's prefix and the secret's name:
org/<name>for an organization secret,projects/<project>/<name>for one attached to a project,me/<name>for your personal one.
A key connection hands the agent its fields: host, port, database, username, password.
Tell the agent in your task description which secret to use, for example “use the IBM Db2 secret org/db2”.
Manage, rotate or disconnect
Everything is on the secret's page under Secrets:
- Rotate a key: create a new key at the vendor first, then select Replace on the secret and paste it. Revoke the old key at IBM Db2 once the test passes. Steps: Replace or delete a secret.
- Disconnect: select Delete. The stored values are destroyed and agents lose access on their next call. To end access at IBM Db2's side too, delete the database role at IBM Db2 or change its password.
Limitations
- Jaah cannot open a Db2 connection to test: it adds no database drivers. Test checks the values' format and that the host is a public address. The first real check is the agent's first query.
- Db2 on Cloud connections must use SSL. Agents connect with Security=SSL.
- A Db2 database name is at most eight characters.
- Agents can do only what the connected IBM Db2 database role allows.
Troubleshooting
Test says Host must name a public address
Use the public hostname from the service credential, not a private endpoint. A private endpoint is reachable only from inside IBM Cloud.
The agent's connection fails with SQL30082N (security processing failed)
The user name or password is wrong, or the credential was deleted. Create a new service credential and select Replace on the secret.
The agent's connection times out
Check the port is the SSL port from the credential and the agent connects with SSL. An IP allowlist on the instance must allow the agent's address.
Still stuck? Select Test and read the result: it names the first value that is missing or not in the shape IBM Db2 uses. It does not call IBM Db2, so IBM Db2's own errors show only in the agent's session.
FAQ
Does it work with Db2 on z/OS or IBM i?
Any Db2 that accepts DRDA connections over SSL from the internet works, but agents need the matching client driver.
Why does Test say IBM Db2 was not called?
Db2 speaks its own database protocol, and Jaah does not run database drivers. So Test checks the format only.
Can Jaah or an admin see the key or token?
No. Jaah stores it encrypted and never shows it again. Only the tasks allowed to use the secret receive it, at the moment they ask for it.
Can I connect more than one IBM Db2 account?
Yes. Add one secret per account, each with its own name, and tell the agent which one to use.