Skip to content

Commit

Permalink
New example for using SQL component
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/camel/trunk@1435080 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
davsclaus committed Jan 18, 2013
1 parent 796b689 commit fc441c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

<!-- START SNIPPET: e1 -->
<!-- this is the JDBC data source which uses an in-memory only Apache Derby database -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver"/>
Expand All @@ -39,7 +40,9 @@
<bean id="sql" class="org.apache.camel.component.sql.SqlComponent">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- END SNIPPET: e1 -->

<!-- START SNIPPET: e2 -->
<!-- order bean is our business logic bean that creates new orders -->
<bean id="orderBean" class="org.apache.camel.example.sql.OrderBean"/>

Expand Down Expand Up @@ -68,5 +71,6 @@
</route>

</camelContext>
<!-- END SNIPPET: e2 -->

</beans>
3 changes: 3 additions & 0 deletions examples/camel-example-sql/src/main/resources/sql.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
## limitations under the License.
## ------------------------------------------------------------------------

## START SNIPPET: e1
## sql that insert new orders
sql.insertOrder=insert into orders (id, item, amount, description, processed) values (:#id, :#item, :#amount, :#description, false)

Expand All @@ -23,3 +24,5 @@ sql.selectOrder=select * from orders where processed = false

## sql that update the order as being processed
sql.markOrder=update orders set processed = true where id = :#id

## END SNIPPET: e1

0 comments on commit fc441c5

Please sign in to comment.