Create a JDBC activity
- UpdatedAug 1, 2024
- 9 minutes to read
- Xanadu
- Orchestration
Create a custom JDBC activity to automate SQL commands and stored procedure calls to relational databases from workflow.
Before you begin
Role required: activity_admin, activity_creator
About this task
Procedure
What to do next
- Test JDBC activity inputs
- Use auto-mapping to generate outputs and parsing rules (recommended for JDBC)
- If you do not use auto-mapping, you can manually create output variables and create parsing rules
Create a JDBC connection for an Orchestration activity
The JDBC Connection [jdbc_connection] table provides the information custom JDBC Orchestration activities use to connect to various target databases.
Before you begin
Role required: activity_admin, activity_creator
About this task
Procedure
Auto-map JDBC activity output variables
The ServiceNow activity designer allows you to map parameter values in a JDBC test payload to variables in the Outputs tab automatically.
Before you begin
Procedure
JDBC stored procedure parameters
You can use Orchestration to run a stored procedure on MySQL, Oracle DB, and MS-SQL databases.
- Only one result-set is returned.
- The order of input and output data types in the stored procedure parameters must match the activity definition.
- Binary, Blob, Varbinary, and LongBinary should be base64 encoded.
- Date, Time, and Timestamp have a specific format:
- Date format: yyyy-mm-dd
- yyyy-mm-dd is the supported format.
- Time format: hh:mm:ss[.sss]
- hh:mm:ss[.sss] is the supported format. Precision is in milliseconds only,
microseconds or nanoseconds cannot be handled. Note:
10:30:59and10:30:59.999000are correct, but10:30:59.is incorrect. - Timestamp format: yyyy-mm-dd hh:mm:ss[.ffffff]
- yyyy-mm-dd hh:mm:ss[.ffffff] is the supported format. Precision is to microseconds.
- ResultSet is the first result set coming back from database server.
- MS-SQL does not support INOUT parameters. If you use INOUT parameters, the Activity Template transparently maps them to OUT parameters.
| Field | Description |
|---|---|
| Mode | Type of stored procedure parameter. Supported parameters:
|
| Sql Type | A SQL data type. Supported data types:
|
| Name/Value | Name-value pairs to pass to the host. You can create these parameters manually, or drag and drop input variables into the parameter fields and assign a value. |
Test JDBC activity template inputs
You can test the input parameters of a custom JDBC activity during its development without having to run the activity in a workflow context.
Before you begin
About this task
Procedure
Related Content
- Create custom activities using custom activity designer templates
You can create and update different types of custom activities in the Workflow Editor using a custom template.
- JDBC credentials