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