...
Header |
Description |
CamelSqlUpdateCount |
The number of rows updated for update operations, returned as an Integer object. |
CamelSqlRowCount |
The number of rows returned for select operations, returned as an Integer object. |
CamelSqlQuery |
Camel 2.8: Query to execute. This query takes precedence over the query specified in the endpoint URI. Note that query parameters in the header are represented by a ? instead of a # symbol |
When performing insert
operations, the SQL Component stores the rows with the generated keys and number of these rown in the following message headers (Available as of Camel 2.12.4, 2.13.1):
Header |
Description |
CamelSqlGeneratedKeysRowCount
|
The number of rows in the header that contains generated keys. |
CamelSqlGeneratedKeyRows
|
Rows that contains the generated keys (a list of maps of keys). |
Generated keys
Available as of Camel 2.12.4, 2.13.1 and 2.14
If you insert data using SQL INSERT, then the RDBMS may support auto generated keys. You can instruct the SQL producer to return the generated keys in headers.
To do that set the header CamelSqlRetrieveGeneratedKeys=true
. Then the generated keys will be provided as headers with the keys listed in the table above.
You can see more details in this unit test.
Configuration
You can now set a reference to a DataSource
in the URI directly:
...