JDBC

JDBC

Description: Camel JDBC support
Scheme: jdbc
Syntax: jdbc:dataSourceName
Maven: org.apache.camel/camel-jdbc/2.16.1

Name Kind Group Required Default Type Enum Description
dataSourceName path producer true java.lang.String Name of DataSource to lookup in the Registry.
allowNamedParameters parameter producer true boolean Whether to allow using named parameters in the queries.
beanRowMapper parameter producer org.apache.camel.component.jdbc.BeanRowMapper To use a custom org.apache.camel.component.jdbc.BeanRowMapper when using outputClass. The default implementation will lower case the row names and skip underscores, and dashes. For example "CUST_ID" is mapped as "custId".
outputClass parameter producer java.lang.String Specify the full package and class name to use as conversion when outputType=SelectOne or SelectList.
outputType parameter producer SelectList org.apache.camel.component.jdbc.JdbcOutputType SelectOne
SelectList
StreamList
Determines the output the producer should use.
prepareStatementStrategy parameter producer org.apache.camel.component.jdbc.JdbcPrepareStatementStrategy Allows to plugin to use a custom org.apache.camel.component.jdbc.JdbcPrepareStatementStrategy to control preparation of the query and prepared statement.
readSize parameter producer int The default maximum number of rows that can be read by a polling query. The default value is 0.
resetAutoCommit parameter producer true boolean 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. If the JDBC connection doesn't support to reset the autoCommit flag, you can set the resetAutoCommit flag to be false, and Camel will not try to reset the autoCommit flag. When used with XA transactions you most likely need to set it to false so that the transaction manager is in charge of committing this tx.
transacted parameter producer boolean Whether transactions are in use.
useGetBytesForBlob parameter producer boolean To read BLOB columns as bytes instead of string data.

This may be needed for certain databases such as Oracle where you must read BLOB columns as bytes.

useHeadersAsParameters parameter producer boolean Set this option to true to use the prepareStatementStrategy with named parameters. This allows to define queries with named placeholders, and use headers with the dynamic values for the query placeholders.
useJDBC4ColumnNameAndLabelSemantics parameter producer true boolean Sets whether to use JDBC 4 or JDBC 3.0 or older semantic when retrieving column name.

JDBC 4.0 uses columnLabel to get the column name where as JDBC 3.0 uses both columnName or columnLabel. Unfortunately JDBC drivers behave differently so you can use this option to work out issues around your JDBC driver if you get problem using this component

This option is default true. @param useJDBC4ColumnNameAndLabelSemantics true to use JDBC 4.0 semantics, false to use JDBC 3.0.

exchangePattern parameter advanced InOnly org.apache.camel.ExchangePattern InOnly
RobustInOnly
InOut
InOptionalOut
OutOnly
RobustOutOnly
OutIn
OutOptionalIn
Sets the default exchange pattern when creating an exchange
synchronous parameter advanced false boolean Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported).