Package org.apache.camel.component.sql
Class DefaultSqlProcessingStrategy
- java.lang.Object
-
- org.apache.camel.component.sql.DefaultSqlProcessingStrategy
-
- All Implemented Interfaces:
SqlProcessingStrategy
public class DefaultSqlProcessingStrategy extends Object implements SqlProcessingStrategy
-
-
Constructor Summary
Constructors Constructor Description DefaultSqlProcessingStrategy(SqlPrepareStatementStrategy sqlPrepareStatementStrategy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
commit(DefaultSqlEndpoint endpoint, org.apache.camel.Exchange exchange, Object data, org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String query)
Commit callback if there are a query to be run after processing.int
commitBatchComplete(DefaultSqlEndpoint endpoint, org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String query)
Commit callback when the batch is complete.
-
-
-
Constructor Detail
-
DefaultSqlProcessingStrategy
public DefaultSqlProcessingStrategy(SqlPrepareStatementStrategy sqlPrepareStatementStrategy)
-
-
Method Detail
-
commit
public int commit(DefaultSqlEndpoint endpoint, org.apache.camel.Exchange exchange, Object data, org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String query) throws Exception
Description copied from interface:SqlProcessingStrategy
Commit callback if there are a query to be run after processing.- Specified by:
commit
in interfaceSqlProcessingStrategy
- Parameters:
endpoint
- the endpointexchange
- The exchange after it has been processeddata
- The original data delivered to the routejdbcTemplate
- The JDBC templatequery
- The SQL query to execute- Returns:
- the update count if the query returned an update count
- Throws:
Exception
- can be thrown in case of error
-
commitBatchComplete
public int commitBatchComplete(DefaultSqlEndpoint endpoint, org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String query) throws Exception
Description copied from interface:SqlProcessingStrategy
Commit callback when the batch is complete. This allows you to do one extra query after all rows has been processed in the batch.- Specified by:
commitBatchComplete
in interfaceSqlProcessingStrategy
- Parameters:
endpoint
- the endpointjdbcTemplate
- The JDBC templatequery
- The SQL query to execute- Returns:
- the update count if the query returned an update count
- Throws:
Exception
- can be thrown in case of error
-
-