This plugin is used to make basic sql statements with the package JayDeBeApi.
You can run any sql statement with this plugin.
For exemple you could insert data before you run your tests.
INSERT INTO test VALUES (1, 'test1')
Or you could retrieve data to validate if it got manipulated correctly during the test.
SELECT * FROM test
You can also save the retrieved data to the data-Object. This of course only makes sense with SELECT Statements. For other statements it will produce an error.
You can also validate the retrieved data. This of course only makes sense with SELECT Statements. For other statements it will produce an error. You can validate against all available datatype (available in yaml)
The call looks like:
- type: JDBC_SQL
call:
query: None
save: []
validate: []
driver: "{{DB_DRIVER}}"
driver_path: "{{DB_DRIVER_PATH}}"
driver_url: "{{DB_DRIVER_URL}}"
url: "{{DB_URL}}"
username: "{{DB_USERNAME}}"
password: "{{DB_PASSWORD}}"
The objects for save look like:
save:
path: "."
to: None
The objects for validate look like:
validate:
path: "."
expected: None
Parameter | Default | Description |
---|---|---|
query | None | The SQL statement to run |
save | [] | Save the result to a variable |
vaidate | [] | Validate the result |
driver | {{DB_DRIVER}} | The Class of the driver |
driver_path | {{DB_DRIVER_PATH}} | The Path to the jar file |
driver_url | {{DB_DRIVER_URL}} | The Url to download the jar file |
url | {{DB_URL}} | The jdbc connection string |
username | {{DB_USERNAME}} | The username of the db |
password | {{DB_PASSWORD}} | The password of the db |