public class JdbcProducer
extends org.apache.camel.impl.DefaultProducer
| Constructor and Description |
|---|
JdbcProducer(JdbcEndpoint endpoint,
DataSource dataSource,
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, createExchange, createExchange, doStart, doStop, isSingleton, toStringdoResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic JdbcProducer(JdbcEndpoint endpoint, DataSource dataSource, int readSize, Map<String,Object> parameters) throws Exception
Exceptionpublic JdbcEndpoint getEndpoint()
getEndpoint in interface org.apache.camel.EndpointAwaregetEndpoint in class org.apache.camel.impl.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