public class JdbcProducer
extends org.apache.camel.support.DefaultProducer
Constructor and Description |
---|
JdbcProducer(JdbcEndpoint endpoint,
DataSource dataSource,
ConnectionStrategy connectionStrategy,
int readSize,
Map<String,Object> parameters) |
Modifier and Type | Method and Description |
---|---|
JdbcEndpoint |
getEndpoint() |
void |
process(org.apache.camel.Exchange exchange)
Execute sql of exchange and set results on output
|
protected void |
setGeneratedKeys(org.apache.camel.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(org.apache.camel.Exchange exchange,
Connection conn,
ResultSet rs)
Sets the result from the ResultSet to the Exchange as its OUT body.
|
createExchange, doStart, doStop, isSingleton, toString
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public JdbcProducer(JdbcEndpoint endpoint, DataSource dataSource, ConnectionStrategy connectionStrategy, int readSize, Map<String,Object> parameters) throws Exception
Exception
public JdbcEndpoint getEndpoint()
getEndpoint
in interface org.apache.camel.EndpointAware
getEndpoint
in class org.apache.camel.support.DefaultProducer
public void process(org.apache.camel.Exchange exchange) throws Exception
Exception
protected void setGeneratedKeys(org.apache.camel.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(org.apache.camel.Exchange exchange, Connection conn, ResultSet rs) throws SQLException
SQLException
Apache Camel