JDBC step
-
- UpdatedJan 30, 2025
- 5 minutes to read
- Yokohama
- Create Workflows
Create a reusable action to send SQL commands to a relational database.
- This step requires an Integration Hub subscription. For more information, see Legal schedules - Integration Hub overview. After the required plugin is activated, the step is visible under Integrations.
- The JDBC step runs only on a ServiceNow® MID Server with JDBC step capabilities. Activate the plugin, Integration Hub Standard Pack Installer (com.glide.hub.integrations.standard) or later to use the JDBC capability for the MID Server.
Roles and availability
The JDBC step is available as an Workflow Studio action step. Users with the action_designer role can create a custom action with one or more action steps.
Sanitizing inputs
Escape all user inputs to eliminate the possibility of a malicious user from executing malicious SQL statements that can result in SQL injection on your target database. When you use data pills in JDBC step SQL statements, sanitize them first using Sanitize SQL transform functions. This transform function category automatically appears when a data pill is dropped into the SQL Statement input.
SQL operations inclusion list
- SELECT
- INSERT
- UPDATE
- DELETE
- SHOW
- DESCRIBE
Fields
Field | Description |
---|---|
Connection Details | |
Connection | Type of connection to use.
To learn more about connections and credentials, see Introduction to credentials, connections, and aliases. |
Connection Alias | Connection & Credential alias record that the system uses to run the action step. Users with the flow_designer or admin role can create or select an associated Connection record. Using an alias eliminates the need to configure multiple credentials and connection information profiles when using an action in multiple environments. Likewise, if the connection information changes, you don't need to update your custom action. To learn more about connections and credentials, see credentials, connections, and aliases. The credential value is displayed as a Password (2 Way Encrypted) data pill on the data panel. This field is available when Use Connection Alias is selected from the Connection list. |
Credential Alias | Credential alias that the system uses to run the action step. Users with the flow_designer or admin role can create or select an associated Connection record. Using an alias eliminates the need to configure multiple credentials when using an action in multiple environments. Likewise, if the credential information changes, you don't need to update your custom action. To learn more about connections and credentials, see credentials, connections, and aliases. The credential value is displayed as a Password (2 Way Encrypted) data pill on the data panel. This field is available when Define Connection Inline is selected from the Connection list. |
MID Selection | Option to select a specific MID Server or MID Cluster. Choose any one of the following options.
|
MID Cluster | Data pill for the MID Cluster you want to use. This field is available when Define Connection Inline is selected from the Connection list, and Specific MID Cluster is selected from the MID Selection list. |
Database Type | Database type for this connection. The choices are:
|
JDBC Driver | Driver to use for this connection when it's not a default database type such as DB2 Universal and Sybase. The database Type is Custom. This field is available when Define Connection Inline is selected from the Connection list and Custom is selected from the Database Type list. |
Connection URL | URL that the MID Server uses to connect to the specified database. The URL is created automatically when you save the form, and is read-only for the default databases. This field is available when Define Connection Inline is selected from the Connection list and Custom is selected from the Database Type list. |
MID Application | Application that the MID Server must support to be eligible for selection. This field is available when Define Connection Inline is selected from the Connection list. |
Capabilities | Capability of the MID Server. SelectJDBC. This field is available when Define Connection Inline is selected from the Connection list. |
Connection Timeout | Maximum elapsed time, in seconds, for the activity to wait while attempting to connect to the target database. This field is available when Define Connection
Inline is selected from the Connection list. Note: Avoid setting the Connection Timeout value to zero, as this may cause a stale connection. |
Query Timeout | Maximum elapsed time, in seconds, that the query is allowed to run without a response. This field is available when Define Connection Inline is selected from the Connection list. |
JDBC Configuration | |
SQL Statement | SQL statement that the step executes. Note: When you use data pills in step
SQL statements, sanitize them first using a preprocessing Script step. For more
information, see Sanitizing inputs using the escape functions. |
Maximum Rows | Maximum number of rows to be returned from the SQL statement. The default value is 1000. |
Maximum Payload Size (KB) | Maximum allowable payload size, in KB, to be returned from the SQL statement. The default payload size is 5120 KB. The maximum payload size is 10 MB. |
Test JDBC Step | Test the JDBC step. View test results directly in the Test JDBC Step window. For more information, see Test JDBC step. |
Retry Policy | |
Enable Retry Policy | Option to enable the retry policy. For more information, see Retry policy. |
Override Default Policy for Alias | Option to override the default retry policy. This option is not applicable when Define Connection Inline is selected from the Connection list. |
Retry Policy | Default retry policy associated with Connection Alias. If Override Default Policy for Alias is selected, you can override the default retry policy and select another existing retry policy based on your requirement. |
Action error evaluation
- If this step fails
- Data type: Choice
Option to continue running the next step or go to error evaluation. To use the step status code or message for a custom action error condition, see Action error evaluation.