JDBC drivers are not included in OOTB TDM docker images.
So, when try to create new connection profile to DB such as MYSQL, DB2, it will raise error like:
"Could not load JDBC driver class"
TDM docker portal
The JDBC drivers need to be deployed in shared PVC under folder lib/data/jdbc-drivers/
There are multiple ways to do that:
$ oc cp mysql-connector-java-8.0.26.jar tdm/tdmweb-5b568cf698-5dfwj:/home/tdm/.tdm/lib/data/jdbc-drivers
$ oc rollout restart deployment/tdmwebIf JDBC driver files are on an internal artifact repository (like Nexus, Artifactory, or a standard internal web server), you can deploy a one-off Kubernetes `Job`. This Job will temporarily mount the shared `tdm` PVC, download the driver, place it in the correct folder, and then terminate permanently.
Here is a simple example of what that Job YAML would look like:
db2-driver-downloader.job.yaml
=====================================
apiVersion: batch/v1
kind: Job
metadata:
name: db2-driver-downloader
namespace: <your-namespace>
spec:
template:
spec:
serviceAccountName: tdm
restartPolicy: Never
containers:
- name: db2-driver-downloader
image: registry.access.redhat.com/ubi8/ubi-minimal:latest
command:
- /bin/sh
- -c
- |
echo "Downloading DB2 driver..."
curl -o /home/tdm/.tdm/lib/data/jdbc-drivers/db2jcc4.jar http://<your-internal-repo>/libs/db2jcc4.jar
echo "Download complete."
volumeMounts:
- name: tdm
mountPath: /home/tdm/.tdm
volumes:
- name: tdm
persistentVolumeClaim:
claimName: tdm
=====================================
If you do not have an internal URL to download the jars from, your CI/CD pipeline team can build a very lightweight custom Docker image that simply contains the `.jar` files, and then run a Job to copy them over.
Step A: Build the Delivery Image
Create a very simple Dockerfile to package the driver:
Dockerfile
=====================================
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
# Copy the DB2 driver from your local build machine into the image
COPY db2jcc4.jar /tmp/drivers/db2jcc4.jar
=====================================
Build and push this tiny image to your internal OpenShift registry (e.g., `your-registry/tdm-db2-installer:v1`).
Step B: Run the Installer Job
Apply a standard Kubernetes Job that uses this image, mounts the TDM persistent volume, and copies the file over:
=====================================
apiVersion: batch/v1
kind: Job
metadata:
name: db2-driver-installer
namespace: <your-namespace>
spec:
template:
spec:
serviceAccountName: tdm
restartPolicy: Never
containers:
- name: db2-driver-installer
image: your-registry/tdm-db2-installer:v1
command:
- /bin/sh
- -c
- "cp /tmp/drivers/db2jcc4.jar /home/tdm/.tdm/lib/data/jdbc-drivers/db2jcc4.jar && echo 'Driver installed successfully.'"
volumeMounts:
- name: tdm
mountPath: /home/tdm/.tdm
volumes:
- name: tdm
persistentVolumeClaim:
claimName: tdm
=====================================
Once OpenShift marks either of these Jobs as `Completed`, the setup is entirely finished.
The JDBC driver is now permanently residing on the shared PVC, and your standard TDM pods will detect the driver immediately.