Matteo Redaelli

Computer Science OpenSource Linux Africa Volontariato Ambiente Energia solare Mezzi Pubblici Piste ciclabili

Using Apache Camel with Ibatis 8 Oct 2008

Filed under: Me — Matteo @ 21:54
Tags: ,

See newer post at

This is a quick tutorial about the usage of the very powerful Integration tool Apache Camel with Apache Ibatis.

Many thanks to Apache Camel forums and Claus Ibsen.


  • I used Java version 1.5.0_16
  • Apache Maven version 2.0.9
  • A database mysql: I used a local db “moodle”, user “moodle”, password “moodle” and a table “mdl_user” [ create table mdl_user ( id int, firstname varchar(30), lastname varchar(30), email varchar(30) ); ]


The full sample project can be download from here!


As suggested by

matteo@nowar:~/workspace$ mvn archetype:create \
-DarchetypeGroupId=org.apache.camel \
-DarchetypeArtifactId=camel-router \
-DarchetypeVersion=1.4.0 \
-DgroupId=org.redaelli \

matteo@nowar:~/workspace$ cd demo-ibatis

matteo@nowar:~/workspace$ mvn eclipse:eclipse

matteo@nowar:~/workspace$ mvn install

Create iBatis files

  • src/main/resources/SqlMapConfig.xml
  • src/main/resources/User.xml
  • src/main/java/org/redaelli/

Add the routes and dependences in the files

  • src/main/java/org/redaelli/
  • pom.xml (adding dependencies “camel-ibatis” e “mysql jdbc”)

And finally run the demo with

matteo@nowar:~/workspace$ mvn camel:run


One Response to “Using Apache Camel with Ibatis”

  1. karthik Says:

    This was a good tutorial. Do you have examples for inserting, updating and deleting?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s