JDBC Task
A JDBC task is a system task used to execute or store information in MySQL.
Definitions
{
"name": "jdbc_test",
"description": "Edit or extend this sample workflow. Set the workflow name to get started",
"version": 1,
"tasks": [
{
"name": "jdbc_task",
"taskReferenceName": "jdbc_task",
"inputParameters": {
"connectionId": "",
"statement": "",
"parameters": [],
"type": "SELECT"
},
"type": "JDBC",
}
]
}
Input Parameters
Attributes | Description |
---|---|
connectionId | Provide the connection ID to establish a connection with the SQL database. For example: postgres://postgres@localhost/testdb |
statement | Provide the SQL statement to retrieve data from the SQL database. An example statement would be SELECT * FROM tableName WHERE id=? , a query used to retrieve data from a table in a database. Replace tableName with the table name from which you want to retrieve data. |
type | Indicates the SQL statement type. It can take 2 values, SELECT or UPDATE.
|
parameters | Provide the query parameters to be bound with the SQL statement. It can be a string, number, boolean, or null. |
Examples
- UI
- JSON Example
- Add task type
JDBC
. - Provide the Connection ID.
- Choose the Statement Type.
- Provide the SQL statement & Query parameters.
{
"name": "jdbc_test",
"description": "Edit or extend this sample workflow. Set the workflow name to get started",
"version": 1,
"tasks": [
{
"name": "jdbc_task",
"taskReferenceName": "jdbc_task",
"inputParameters": {
"connectionId": "postgres://postgres@localhost/testdb",
"statement": "SELECT * FROM orkes",
"parameters": [],
"type": "SELECT"
},
"type": "JDBC",
}
]
}