Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Name

Default Value

Description

readSize

20000

The default maximum number of rows that can be read by a polling query

Result

The result is returned in the out body as a ArrayList<HashMap<String, Object>> list object with the result. The ArrayList contains the list of rows and the Map contains each row with the string key as the column name.

Samples

In the sample below we fetches the rows from the customer table.TODO: snippet for inlined code

First we register our datasource in the Camel registry as testdb:

Wiki Markup
{snippet:id=register|lang=java|url=activemq/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcRouteTest.java}

Then we configure a route that routes to the JDBC component so the SQL will be executed, notice that we refer to the testdb datasource that was bound in the previous step:

Wiki Markup
{snippet:id=route|lang=java|url=activemq/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcRouteTest.java}

And then we create the endpoint and sends the exchange containing the SQL query to execute in the in body. The result is returned in the out body.

Wiki Markup
{snippet:id=invoke|lang=java|url=activemq/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcRouteTest.java}
Include Page
CAMEL:Endpoint See Also
CAMEL:Endpoint See Also