Setting Up iBATIS
Harry
· 11 Sep 2026
· 11 views
The iBATIS 2.x Dependency
Legacy projects add the iBATIS jar and a JDBC driver to their build. The Maven coordinates for the last Apache release are shown below.
<dependency>
<groupId>org.apache.ibatis.ibator</groupId>
<!-- legacy iBATIS jars are typically vendored -->
</dependency>In practice most iBATIS projects vendor the jar directly or pull it from an internal repository, so you will usually add it by hand.
Minimal Project Layout
src/
java/com/example/app/
domain/Customer.java
dao/CustomerDAO.java
resources/
SqlMapConfig.xml
Customer.xml
jdbc.propertiesBootstrapping SqlMapClient
String resource = "SqlMapConfig.xml";
Reader reader = Resources.getResourceAsReader(resource);
SqlMapClient sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);SqlMapClient is the iBATIS equivalent of MyBatis SqlSessionFactory; it hands you sessions for executing mapped statements.
Key Points
- iBATIS projects usually vendor the jar.
- SqlMapConfig.xml is the central configuration.
- SQL mapping files sit beside it and are listed there.
- SqlMapClientBuilder builds the entry point.