Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Configuration of SQL component added

...

Result of the invocation is effectively List<Map<String, Object>> as returned from JdbcTemplate.queryForList() method.

Configuration

SQL component has to be configured before it can be used. In Spring it can be done this way:

Code Block
xml
xml

<bean id="sql" class="org.apache.camel.component.sql.SqlComponent"/>
  <property name="dataSource" ref="myDS"/>
</bean>

<bean id="myDS"
    class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url" value="jdbc:mysql://localhost:3306/ds" />
    <property name="username" value="username" />
    <property name="password" value="password" />
</bean>

Options

All options that are available are prefixed by template. and are properties of JdbcTemplate class. For detailed documentation see JdbcTemplate javadoc documentation.

...