Set up JDBC drivers on KNIME Hub and KNIME Server
Distribute JDBC drivers to KNIME Hub and KNIME Server executors using customization profiles. This ensures all executors and connected KNIME Analytics Platform clients use the same drivers without manual per-machine registration.
Before you begin
- You have administrator access to KNIME Hub or KNIME Server.
- You have obtained the JDBC driver
.jarfile from your database vendor.
Create a customization profile with the driver
Server-side steps
Create the customization profile on the KNIME Hub or KNIME Server repository.
- Create a profile folder inside
<server-repository>/config/client-profiles. The folder name becomes the profile name. - Copy the
.jarfile into the profile folder. - In the profile folder, create a preferences file (
.epfextension) with the following content:
text
/instance/org.knime.database/drivers/<DRIVER_ID>/database_type=<DATABASE>
/instance/org.knime.database/drivers/<DRIVER_ID>/driver_class=<DRIVER_CLASS_NAME>
/instance/org.knime.database/drivers/<DRIVER_ID>/paths/0=${profile:location}/<DRIVER_JAR>
/instance/org.knime.database/drivers/<DRIVER_ID>/url_template=<URL_TEMPLATE>
/instance/org.knime.database/drivers/<DRIVER_ID>/version=<DRIVER_VERSION>Replace the placeholders as follows:
| Placeholder | Description |
|---|---|
<DRIVER_ID> | Unique identifier. Alphanumeric characters and underscores only. |
<DATABASE> | Database type (for example, mysql, postgresql). See the Databases preferences page for available types. |
<DRIVER_CLASS_NAME> | JDBC driver class (for example, oracle.jdbc.OracleDriver). |
<DRIVER_JAR> | Filename of the .jar file (including extension). ${profile:location} resolves to the profile folder on each client. |
<URL_TEMPLATE> | JDBC URL template. Escape colons (:) and backslashes (\) with a backslash. Example: jdbc\:oracle\:thin\:@<host>\:<port>/<database>. See JDBC driver reference for template syntax. |
<DRIVER_VERSION> | Driver version string (for example, 12.2.0). |
- Configure KNIME Server executors to request the profile by adding the profile name to the
knime.inifile of each executor. See the KNIME Server Administration Guide for details.
Client-side steps
KNIME Analytics Platform clients must be made aware of the customization profile to request it from KNIME Server.
- In KNIME Analytics Platform, go to File → Preferences → KNIME → Customization Profiles.
- Select the KNIME Server and the profile to apply.
- Restart KNIME Analytics Platform for the changes to take effect.
To verify the driver was added, go to File → Preferences → KNIME → Databases. Drivers added via a customization profile are marked as origin: profile after the driver ID.
Profile-sourced drivers can be edited but not deleted from this page. To remove a profile driver, deselect the profile on the Customization Profiles page.
Set default JDBC parameters
Hub administrators can inject JDBC parameters into all connections made from workflows running on KNIME Hub. These parameters take precedence over values set in the connector node.
Add the following lines to the .epf file of your customization profile:
text
/instance/org.knime.database/drivers/<DRIVER_ID>/attributes/additional/org.knime.database.util.DerivableProperties/knime.db.connection.jdbc.properties/<JDBC_PARAMETER>/type=<TYPE>
/instance/org.knime.database/drivers/<DRIVER_ID>/attributes/additional/org.knime.database.util.DerivableProperties/knime.db.connection.jdbc.properties/<JDBC_PARAMETER>/value=<VALUE>Supported <TYPE> values:
| Type | Value description |
|---|---|
CONTEXT_PROPERTY | A workflow context property. See available variables below. |
CREDENTIALS_LOGIN | Username from a named credentials flow variable. |
CREDENTIALS_PASSWORD | Password from a named credentials flow variable. |
DELEGATED_GSS_CREDENTIAL | Delegated GSS credential (Kerberos, Hub execution only). |
FLOW_VARIABLE | Name of a flow variable. |
GSS_PRINCIPAL_NAME | Kerberos principal name including the REALM. |
GSS_PRINCIPAL_NAME_WITHOUT_REALM | Kerberos principal name without the REALM. |
LITERAL | A literal string value. |
LOCAL_URL | A URL such as a knime: URL. |
Available CONTEXT_PROPERTY variables:
context.workflow.namecontext.workflow.pathcontext.workflow.absolute-pathcontext.workflow.usernamecontext.workflow.temp.locationcontext.workflow.author.namecontext.workflow.last.editor.namecontext.workflow.creation.datecontext.workflow.last.time.modifiedcontext.job.id
Reserve JDBC parameters
Mark a JDBC parameter as reserved to prevent workflows from using it on KNIME Hub. This is useful for security-sensitive parameters such as DelegationUID.
text
/instance/org.knime.database/drivers/<DRIVER_ID>/attributes/reserved/*/knime.db.connection.jdbc.properties/<JDBC_PARAMETER>=trueSet a connection initialization statement
Inject a SQL statement that runs every time a JDBC connection is created from a workflow on KNIME Hub:
text
/instance/org.knime.database/drivers/<DRIVER_ID>/attributes/additional/java.lang.String/knime.db.connection.init_statement/value=<VALUE>Use ${variable-name} syntax to include CONTEXT_PROPERTY variables in the statement. For example:
text
IMPERSONATE ${context.workflow.username};