@UriEndpoint(firstVersion="1.2.0",
scheme="jdbc",
title="JDBC",
syntax="jdbc:dataSourceName",
producerOnly=true,
label="database,sql")
public class JdbcEndpoint
extends org.apache.camel.support.DefaultEndpoint
Constructor and Description |
---|
JdbcEndpoint() |
JdbcEndpoint(String endpointUri,
org.apache.camel.Component component,
DataSource dataSource) |
Modifier and Type | Method and Description |
---|---|
org.apache.camel.Consumer |
createConsumer(org.apache.camel.Processor processor) |
protected String |
createEndpointUri() |
org.apache.camel.Producer |
createProducer() |
BeanRowMapper |
getBeanRowMapper() |
DataSource |
getDataSource() |
String |
getDataSourceName() |
String |
getOutputClass() |
JdbcOutputType |
getOutputType() |
Map<String,Object> |
getParameters() |
JdbcPrepareStatementStrategy |
getPrepareStatementStrategy() |
int |
getReadSize() |
boolean |
isAllowNamedParameters() |
boolean |
isResetAutoCommit() |
boolean |
isTransacted() |
boolean |
isUseGetBytesForBlob() |
boolean |
isUseHeadersAsParameters() |
boolean |
isUseJDBC4ColumnNameAndLabelSemantics() |
void |
setAllowNamedParameters(boolean allowNamedParameters)
Whether to allow using named parameters in the queries.
|
void |
setBeanRowMapper(BeanRowMapper beanRowMapper)
To use a custom org.apache.camel.component.jdbc.BeanRowMapper when using outputClass.
|
void |
setDataSource(DataSource dataSource)
The data source to use
|
void |
setDataSourceName(String dataSourceName)
Name of DataSource to lookup in the Registry.
|
void |
setOutputClass(String outputClass)
Specify the full package and class name to use as conversion when outputType=SelectOne or SelectList.
|
void |
setOutputType(JdbcOutputType outputType)
Determines the output the producer should use.
|
void |
setParameters(Map<String,Object> parameters)
Optional parameters to the
Statement . |
void |
setPrepareStatementStrategy(JdbcPrepareStatementStrategy prepareStatementStrategy)
Allows to plugin to use a custom org.apache.camel.component.jdbc.JdbcPrepareStatementStrategy to control preparation of the query and prepared statement.
|
void |
setReadSize(int readSize)
The default maximum number of rows that can be read by a polling query.
|
void |
setResetAutoCommit(boolean resetAutoCommit)
Camel will set the autoCommit on the JDBC connection to be false, commit the change after executed the statement and reset
the autoCommit flag of the connection at the end, if the resetAutoCommit is true.
|
void |
setTransacted(boolean transacted)
Whether transactions are in use.
|
void |
setUseGetBytesForBlob(boolean useGetBytesForBlob)
To read BLOB columns as bytes instead of string data.
|
void |
setUseHeadersAsParameters(boolean useHeadersAsParameters)
Set this option to true to use the prepareStatementStrategy with named parameters.
|
void |
setUseJDBC4ColumnNameAndLabelSemantics(boolean useJDBC4ColumnNameAndLabelSemantics)
Sets whether to use JDBC 4 or JDBC 3.0 or older semantic when retrieving column name.
|
configureConsumer, configurePollingConsumer, configureProperties, createAsyncProducer, createExchange, createExchange, createPollingConsumer, doInit, doStart, doStop, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBasicPropertyBinding, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isSingleton, isSynchronous, setBasicPropertyBinding, setBridgeErrorHandler, setCamelContext, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
build, doBuild, doResume, doShutdown, doSuspend, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public JdbcEndpoint()
public JdbcEndpoint(String endpointUri, org.apache.camel.Component component, DataSource dataSource)
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
Exception
public String getDataSourceName()
public void setDataSourceName(String dataSourceName)
public int getReadSize()
public void setReadSize(int readSize)
public boolean isTransacted()
public void setTransacted(boolean transacted)
public boolean isResetAutoCommit()
public void setResetAutoCommit(boolean resetAutoCommit)
public DataSource getDataSource()
public void setDataSource(DataSource dataSource)
public void setParameters(Map<String,Object> parameters)
Statement
.
For example to set maxRows, fetchSize etc.parameters
- parameters which will be set using reflectionpublic boolean isUseJDBC4ColumnNameAndLabelSemantics()
public void setUseJDBC4ColumnNameAndLabelSemantics(boolean useJDBC4ColumnNameAndLabelSemantics)
useJDBC4ColumnNameAndLabelSemantics
- true to use JDBC 4.0 semantics, false to use JDBC 3.0.public JdbcPrepareStatementStrategy getPrepareStatementStrategy()
public void setPrepareStatementStrategy(JdbcPrepareStatementStrategy prepareStatementStrategy)
public boolean isAllowNamedParameters()
public void setAllowNamedParameters(boolean allowNamedParameters)
public boolean isUseHeadersAsParameters()
public void setUseHeadersAsParameters(boolean useHeadersAsParameters)
public JdbcOutputType getOutputType()
public void setOutputType(JdbcOutputType outputType)
public String getOutputClass()
public void setOutputClass(String outputClass)
public BeanRowMapper getBeanRowMapper()
public void setBeanRowMapper(BeanRowMapper beanRowMapper)
public boolean isUseGetBytesForBlob()
public void setUseGetBytesForBlob(boolean useGetBytesForBlob)
protected String createEndpointUri()
createEndpointUri
in class org.apache.camel.support.DefaultEndpoint
Apache Camel