org.apache.camel.component.sql
Class SqlEndpoint

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.impl.DefaultEndpoint
          extended by org.apache.camel.impl.ScheduledPollEndpoint
              extended by org.apache.camel.impl.DefaultPollingEndpoint
                  extended by org.apache.camel.component.sql.SqlEndpoint
All Implemented Interfaces:
org.apache.camel.CamelContextAware, org.apache.camel.Endpoint, org.apache.camel.IsSingleton, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasId, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

@UriEndpoint(scheme="sql",
             consumerClass=SqlConsumer.class)
public class SqlEndpoint
extends org.apache.camel.impl.DefaultPollingEndpoint

SQL Endpoint. Endpoint URI should contain valid SQL statement, but instead of question marks (that are parameter placeholders), sharp signs should be used. This is because in camel question mark has other meaning.


Field Summary
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
SqlEndpoint()
           
SqlEndpoint(String uri, org.apache.camel.Component component, org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String query)
           
 
Method Summary
 org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
           
protected  String createEndpointUri()
           
 org.apache.camel.Producer createProducer()
           
 org.springframework.jdbc.core.JdbcTemplate getJdbcTemplate()
           
 int getMaxMessagesPerPoll()
           
 String getOnConsume()
           
 String getOnConsumeBatchComplete()
           
 String getOnConsumeFailed()
           
 String getOutputClass()
           
 SqlOutputType getOutputType()
           
 int getParametersCount()
           
 SqlPrepareStatementStrategy getPrepareStatementStrategy()
           
 SqlProcessingStrategy getProcessingStrategy()
           
 String getQuery()
           
 char getSeparator()
           
 boolean isAllowNamedParameters()
           
 boolean isAlwaysPopulateStatement()
           
 boolean isBatch()
           
 boolean isNoop()
           
 boolean isSingleton()
           
protected  List<Map<String,Object>> queryForList(ResultSet rs)
           
protected  Object queryForObject(ResultSet rs)
           
 void setAllowNamedParameters(boolean allowNamedParameters)
           
 void setAlwaysPopulateStatement(boolean alwaysPopulateStatement)
           
 void setBatch(boolean batch)
          Enables or disables batch mode
 void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
           
 void setMaxMessagesPerPoll(int maxMessagesPerPoll)
          Sets the maximum number of messages to poll
 void setNoop(boolean noop)
           
 void setOnConsume(String onConsume)
           
 void setOnConsumeBatchComplete(String onConsumeBatchComplete)
           
 void setOnConsumeFailed(String onConsumeFailed)
           
 void setOutputClass(String outputClass)
           
 void setOutputType(SqlOutputType outputType)
           
 void setParametersCount(int parametersCount)
           
 void setPrepareStatementStrategy(SqlPrepareStatementStrategy prepareStatementStrategy)
           
 void setProcessingStrategy(SqlProcessingStrategy processingStrategy)
           
 void setQuery(String query)
          Sets the SQL query to perform
 void setSeparator(char separator)
           
 
Methods inherited from class org.apache.camel.impl.ScheduledPollEndpoint
configurePollingConsumer, configureProperties, configureScheduledPollConsumerProperties
 
Methods inherited from class org.apache.camel.impl.DefaultEndpoint
configureConsumer, createEndpointConfiguration, createExchange, createExchange, createExchange, createPollingConsumer, doStart, doStop, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExchangePattern, getId, hashCode, isLenientProperties, isSynchronous, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setProperties, setSynchronous, toString
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Constructor Detail

SqlEndpoint

public SqlEndpoint()

SqlEndpoint

public SqlEndpoint(String uri,
                   org.apache.camel.Component component,
                   org.springframework.jdbc.core.JdbcTemplate jdbcTemplate,
                   String query)
Method Detail

createConsumer

public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
                                         throws Exception
Specified by:
createConsumer in interface org.apache.camel.Endpoint
Overrides:
createConsumer in class org.apache.camel.impl.DefaultPollingEndpoint
Throws:
Exception

createProducer

public org.apache.camel.Producer createProducer()
                                         throws Exception
Throws:
Exception

isSingleton

public boolean isSingleton()

getJdbcTemplate

public org.springframework.jdbc.core.JdbcTemplate getJdbcTemplate()

setJdbcTemplate

public void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)

getQuery

public String getQuery()

setQuery

public void setQuery(String query)
Sets the SQL query to perform


isBatch

public boolean isBatch()

setBatch

public void setBatch(boolean batch)
Enables or disables batch mode


getMaxMessagesPerPoll

public int getMaxMessagesPerPoll()

setMaxMessagesPerPoll

public void setMaxMessagesPerPoll(int maxMessagesPerPoll)
Sets the maximum number of messages to poll


getProcessingStrategy

public SqlProcessingStrategy getProcessingStrategy()

setProcessingStrategy

public void setProcessingStrategy(SqlProcessingStrategy processingStrategy)

getPrepareStatementStrategy

public SqlPrepareStatementStrategy getPrepareStatementStrategy()

setPrepareStatementStrategy

public void setPrepareStatementStrategy(SqlPrepareStatementStrategy prepareStatementStrategy)

getOnConsume

public String getOnConsume()

setOnConsume

public void setOnConsume(String onConsume)

getOnConsumeFailed

public String getOnConsumeFailed()

setOnConsumeFailed

public void setOnConsumeFailed(String onConsumeFailed)

getOnConsumeBatchComplete

public String getOnConsumeBatchComplete()

setOnConsumeBatchComplete

public void setOnConsumeBatchComplete(String onConsumeBatchComplete)

isAllowNamedParameters

public boolean isAllowNamedParameters()

setAllowNamedParameters

public void setAllowNamedParameters(boolean allowNamedParameters)

isAlwaysPopulateStatement

public boolean isAlwaysPopulateStatement()

setAlwaysPopulateStatement

public void setAlwaysPopulateStatement(boolean alwaysPopulateStatement)

getSeparator

public char getSeparator()

setSeparator

public void setSeparator(char separator)

getOutputType

public SqlOutputType getOutputType()

setOutputType

public void setOutputType(SqlOutputType outputType)

getOutputClass

public String getOutputClass()

setOutputClass

public void setOutputClass(String outputClass)

getParametersCount

public int getParametersCount()

setParametersCount

public void setParametersCount(int parametersCount)

isNoop

public boolean isNoop()

setNoop

public void setNoop(boolean noop)

createEndpointUri

protected String createEndpointUri()
Overrides:
createEndpointUri in class org.apache.camel.impl.DefaultEndpoint

queryForList

protected List<Map<String,Object>> queryForList(ResultSet rs)
                                         throws SQLException
Throws:
SQLException

queryForObject

protected Object queryForObject(ResultSet rs)
                         throws SQLException
Throws:
SQLException


Apache Camel