JDBC Task
A JDBC task is a system task used to execute or store information in SQL databases.
Definitions
{
"name": "jdbc",
"taskReferenceName": "jdbc_ref",
"inputParameters": {
"integrationName": "db-001",
"statement": "SELECT * FROM tableName WHERE id=?",
"parameters": [
"${workflow.input.text}"
],
"type": "SELECT"
},
"type": "JDBC",
"cacheConfig": {
"ttlInSecond": 3600,
"key": "key"
},
"optional": false
}
Input Parameters
Attribute | Description |
---|---|
integrationName | Choose the required database integration. You can only choose the integration to which you have access here. Note: If you haven’t configured your database on your Orkes console, navigate to the Integrations tab and configure the integration under “RDBMS > Relational Database”. |
type | Indicates the SQL statement type. It can take 2 values: SELECT or UPDATE.
|
statement | Provide the SQL statement to retrieve data from the SQL database. Example: SELECT * FROM tableName WHERE id=?, a query used to retrieve data from a table in a database. Replace tableName with the actual table name. |
parameters | Provide the query parameters to be bound by the SQL statement. It can be a string, number, boolean, or null. |
cacheConfig | Enabling this option allows saving the cache output of the task. On enabling, you can provide the following parameters:
|
optional | Enabling this option renders the task optional. The workflow continues unaffected by the task's outcome, whether it fails or remains incomplete. |
Examples
- UI
- JSON
- Add task type JDBC.
- Choose the integration name.
- Choose the Statement Type.
- Provide the SQL statement & Query parameters.
{
"name": "jdbc",
"taskReferenceName": "jdbc_ref",
"inputParameters": {
"integrationName": "db-001",
"statement": "SELECT * FROM tableName WHERE id=?",
"parameters": [
"${workflow.input.text}"
],
"type": "SELECT"
},
"type": "JDBC",
"cacheConfig": {
"ttlInSecond": 3600,
"key": "key"
},
"optional": false
}