org.apache.camel.component.sql
Class DefaultSqlProcessingStrategy

java.lang.Object
  extended by org.apache.camel.component.sql.DefaultSqlProcessingStrategy
All Implemented Interfaces:
SqlProcessingStrategy

public class DefaultSqlProcessingStrategy
extends Object
implements SqlProcessingStrategy


Constructor Summary
DefaultSqlProcessingStrategy(SqlPrepareStatementStrategy sqlPrepareStatementStrategy)
           
 
Method Summary
 int commit(SqlEndpoint 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(SqlEndpoint endpoint, org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String query)
          Commit callback when the batch is complete.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSqlProcessingStrategy

public DefaultSqlProcessingStrategy(SqlPrepareStatementStrategy sqlPrepareStatementStrategy)
Method Detail

commit

public int commit(SqlEndpoint 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 interface SqlProcessingStrategy
Parameters:
endpoint - the endpoint
exchange - The exchange after it has been processed
data - The original data delivered to the route
jdbcTemplate - The JDBC template
query - 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(SqlEndpoint 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 interface SqlProcessingStrategy
Parameters:
endpoint - the endpoint
jdbcTemplate - The JDBC template
query - 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


Apache Camel