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, toStringbuild, 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, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic JdbcProducer(JdbcEndpoint endpoint, DataSource dataSource, ConnectionStrategy connectionStrategy, int readSize, Map<String,Object> parameters) throws Exception
Exceptionpublic JdbcEndpoint getEndpoint()
getEndpoint in interface org.apache.camel.EndpointAwaregetEndpoint in class org.apache.camel.support.DefaultProducerpublic void process(org.apache.camel.Exchange exchange)
throws Exception
Exceptionprotected 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 keysSQLExceptionprotected boolean setResultSet(org.apache.camel.Exchange exchange,
Connection conn,
ResultSet rs)
throws SQLException
SQLExceptionApache Camel