--- title: Create a JDBC activity description: Create a custom JDBC activity to automate SQL commands and stored procedure calls to relational databases from workflow.The JDBC Connection \[jdbc\_connection\] table provides the information custom JDBC Orchestration activities use to connect to various target databases.The ServiceNow activity designer allows you to map parameter values in a JDBC test payload to variables in the Outputs tab automatically.You can use Orchestration to run a stored procedure on MySQL, Oracle DB, and MS-SQL databases.You can test the input parameters of a custom JDBC activity during its development without having to run the activity in a workflow context. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/servicenow-platform/orchestration/t\_CreateAJDBCActivity.html release: australia product: Orchestration classification: orchestration topic_type: task last_updated: "2026-03-12" reading_time_minutes: 11 breadcrumb: [Orchestration custom activity templates, Orchestration activity designer, Classic Orchestration, ServiceNow AI Platform Additional Capabilities, Extend ServiceNow AI Platform capabilities] --- # Create a JDBC activity 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 The JDBC activity template allows you to execute ANSI SQL statements or stored procedures on a target database. Support for stored procedures with IN, OUT, and INOUT parameters are available in Australia. To learn how to set up these parameters, see [JDBC stored procedure parameters](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/t_CreateAJDBCActivity.md). **Note:** If you are transferring bulk data into a ServiceNow instance from an external data source, use [Import sets key concepts](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/integrate-applications/c_ImportSetsKeyConcepts.md). The JDBC activities allow you to transfer data between external data sources and ServiceNow within a workflow. It is not intended to replace the bulk import features of data sources. ## Procedure 1. Create or verify your [JDBC credential](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/r_JDBCCredentialsForm.md). Your JDBC credentials must have permission for the target database and proper configuration for the corresponding JDBC connection. Credentials must be set up before you can create a JDBC activity. 2. Create or verify your [JDBC connection](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/t_CreateAJDBCActivity.md). Your JDBC connection must be configured with valid JDBC credentials set up before you can create a JDBC activity. 3. Create a [custom activity](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/integrate-applications/create-custom-activities.md). This action creates a custom activity using a template. 4. After setting up [general properties](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/General-Flds-Templates.md) and [creating input variables](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/CreateInputVariables.md), configure the JDBC Execution Command.
| **[JDBC Connection](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/t_CreateAJDBCActivity.md)** | Configure or reference the appropriate JDBC Connection for the database. The connection selected provides the activity with the following information: - Target database information \(server and database names\) - Connection URL - Target database port \(if different from standard port number\) - Database instance name |
| **Credential** | JDBC credential to use for your JDBC connection. |
| **SQL statement** | Input the ANSI SQL to execute on the JDBC target database. **Note:** This field is hidden when the Stored Procedure check box is selected. You can [map the input variables](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/CreateInputVariables.md) you created to configure the SQL statements. By default, you can run the following SQL statements. - select - insert - update - delete - show - create - describe For added security measure, a MID Server property controls the operations that this JDBCOrchestrationProbe executes, which restricts the SQL commands used. This property protects against potentially destructive commands, such as drop database. The mid.property.jdbc\_operations contains the MID Server property controls.**Note:** You cannot run multiple statements of different types. For example, you cannot run a select statement and an update statement together, but you can run two insert statements. However, you cannot run multiple select statements in this activity. |
| **Maximum rows** | Maximum number of records to retrieve from database. The default is 1000. |
| **Maximum payload size \(KB\)** | You can set a limit on the maximum payload size of data retrieved from the database. The default is 64 kilobytes. |
| **Connection timeout** | How long the activity waits to make the connection. This field is populated automatically from the data source, but can be changed for this activity. |
| **Query timeout** | Elapsed time to wait after running the query until the data is returned. This field is populated automatically from the data source, but can be changed for this activity. |
| **Required MID Server capabilities** | MID Server to use for querying JDBC, by capabilities. By default, the system selects a MID Server that has JDBC capability. |
| **Use stored procedure** | If checked, you can run a stored procedure on MySQL, Oracle, or SQL Server databases by entering the procedure name and parameters. See [JDBC stored procedure parameters](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/orchestration/t_CreateAJDBCActivity.md). |
| Field | Database Format | Description |
|---|---|---|
| Name | All | Unique name of this JDBC connection. For example, you might enter **JDBC MySQLProd**. |
| Query timeout | All | Maximum elapsed time the JDBC query is allowed to run without a response. |
| Connection timeout | All | Maximum elapsed time for the JDBC activity to wait while attempting to connect to the target database. |
| Application | All | Scope for this table. By default, the JDBC Connection \[jdbc\_connection\] table runs in the **Global** scope. |
| Domain | All | Domain for this table. By default, the JDBC Connection \[jdbc\_connection\] table runs in the **global** domain. |
| Format | All | Database type for this connection. The default choices are: - **MySQL** - **Oracle** - **SQLServer** - **None** You can add **Sybase** or **DB2 Universal** to the choice list by uploading the appropriate JDBC driver JAR file to the instance. Orchestration automatically recognizes these drivers when they are loaded into the system and adds them to this list. |
| Server | Oracle, MySQL, SQLServer | Host name or IP address of the database server. |
| Oracle sid | Oracle | The Oracle database site identifier. The default value is **orcl**. |
| Oracle port | Oracle | Port that the Oracle database is using. The default value is **1521**. |
| Database name | MySQL, SQLServer | Name of the database. |
| Database port | My SQL, SQLServer | Port that the selected database is using. |
| Instance name | SQLServer | Instance name for the selected SQLServer |
| Connection URL | All | 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. **Note:** If the format selected is not one of the default databases, you must create the connection URL manually so that the MID Server knows how to create the connection. |
| JDBC driver | None, DB2 Universal, Sybase | The JDBC driver to use for this connection when it is not a default database. **Note:** If you add a Sybase or DB2 Universal database, you must enter the driver name in this field and upload the driver JAR file to the instance. |
| Field | Description |
|---|---|
| Mode | Type of stored procedure parameter. Supported parameters:- IN - OUT - INOUT |
| Sql Type | A SQL data type. Supported data types:- ARRAY - BIGINT - BINARY - BIT - BLOB - CHAR - CLOB - DATE - DECIMAL - DISTINCT - DOUBLE - FLOAT - INT - INTEGER - JAVA\_OBJECT - LONGVARBINARY - LONGVARCHAR - NULL - NUMERIC - OTHER - REAL - REF - REF\_CURSOR - SMALLINT - STRUCT - TIME - TIMESTAMP - TINYINT - VARBINARY - VARCHAR |
| 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. |