public class JdbcProducer extends DefaultProducer
log
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
JdbcProducer(JdbcEndpoint endpoint,
DataSource dataSource,
int readSize,
Map<String,Object> parameters) |
Modifier and Type | Method and Description |
---|---|
JdbcEndpoint |
getEndpoint()
Gets the endpoint associated with an object.
|
void |
process(Exchange exchange)
Execute sql of exchange and set results on output
|
protected void |
setGeneratedKeys(Exchange exchange,
Connection conn,
ResultSet generatedKeys)
Sets the generated if any to the Exchange in headers :
-
JdbcConstants.JDBC_GENERATED_KEYS_ROW_COUNT : the row count of generated keys
- JdbcConstants.JDBC_GENERATED_KEYS_DATA : the generated keys data |
protected boolean |
setResultSet(Exchange exchange,
Connection conn,
ResultSet rs)
Sets the result from the ResultSet to the Exchange as its OUT body.
|
createExchange, createExchange, createExchange, doStart, doStop, isSingleton, toString
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public JdbcProducer(JdbcEndpoint endpoint, DataSource dataSource, int readSize, Map<String,Object> parameters) throws Exception
Exception
public JdbcEndpoint getEndpoint()
EndpointAware
Producer
or for consuming from for components like Consumer
or Route
getEndpoint
in interface EndpointAware
getEndpoint
in class DefaultProducer
public void process(Exchange exchange) throws Exception
exchange
- the message exchangeException
- if an internal processing error has occurred.protected void setGeneratedKeys(Exchange exchange, Connection conn, ResultSet generatedKeys) throws SQLException
JdbcConstants.JDBC_GENERATED_KEYS_ROW_COUNT
: the row count of generated keys
- JdbcConstants.JDBC_GENERATED_KEYS_DATA
: the generated keys dataexchange
- The exchange where to store the generated keysconn
- Current JDBC connectiongeneratedKeys
- The result set containing the generated keysSQLException
protected boolean setResultSet(Exchange exchange, Connection conn, ResultSet rs) throws SQLException
SQLException
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.