JDBC vs IBATIS vs Hibernate

Christoph has spent the last couple of weeks refactoring a web project to use IBATIS instead of Hibernate. I also refactored a smaller project to use IBATIS instead of JDBC. Here’s our take on the issues:

If you like JDBC and PreparedStatements, you’ll feel comfortable with IBATIS. It doesn’t force any major changes on you and reduces the lines of boilerplate code you’ll need for your database access. It has other benefits as well, such as automatically handling boolean and date mappings which are tedious and error-prone in JDBC.

We had successfully used Hibernate in a number of other projects, but in this particular project, Hibernate turned out to be an awkward fit. The problem was that we already had a database model which we couldn’t change and furthermore, we were porting an existing code base. This combination proved overly complex with Hibernate and we eventually redid the DAO in IBATIS, resulting in a much simpler port.

In summary, if you’re having difficulties integrating Hibernate into your application, consider using IBATIS instead – you get many of the benefits of ORM without the paradigm shifts which Hibernate implies.

2 Responses to “JDBC vs IBATIS vs Hibernate”

  1. uwe schaefer Says:

    could not agree more. i am using hibernate for ages, and i hate it more and more every day. IF bound to sql, ibatis is probably an interesting tool by not trying to be too clever.

    when starting fresh projects, though – it might be worth considering even a nosql contender to data persistence.

  2. roger Says:

    Whoops Uwe – sorry to be replying after 3 months – your comment got spammed by Wordpress.

    Anyway, good point about the nosql databases – especially if you need to consider cloud deployment, its probably a good idea to consider something like couchDB. Most of our projects deal with some kind of legacy SQL database, so that was the perspective we were coming from. We’re currently considering how we might use a nosql db like couchDB as a cache for large numbers of complex objects in our systems (for instance for the objects used for generating reports on a company database with millions of companies). This seems analagous to using Solr to cache the same data for search purposes.

Leave a Reply


WordPress Appliance - Powered by TurnKey Linux