Chapter 3. Installing and configuring iBATIS

 

This chapter covers

  • Getting iBATIS
  • iBATIS vs. JDBC
  • Configuration basics

Installing iBATIS is a quick and simple process. Because it is a library, and not an application, there is no installation process, but you do need to go through a few steps to use iBATIS in your application.

If you are familiar with Java and JDBC, then you will probably read all you need to get up and running in the next paragraph or two. Just in case, we provide an overview of the process that you can read through, and then the rest of the chapter gives more details on the installation process.

To get iBATIS, you have two choices. You can either download a binary distribution and unzip it into a directory, or check out a copy of the source from the Subversion repository and build it. In either case, you will have the same set of files when you are done.

Once you have a build of the distribution, you simply need to add the required JAR files to your application’s classpath. If you are using JDK 1.4 or later, there are only two required files:

  • ibatis-common-2.jar Shared iBATIS classes[1]

    1 By the time you read this, the common jar file may be merged into a single JAR file with the sqlmap classes, thus reducing the classpath requirement to a single JAR file and further simplifying deployment.

  • ibatis-sqlmap-2.jar The iBATIS SQL mapping classes

3.1. Getting an iBATIS distribution

3.2. Distribution contents

3.3. Dependencies

3.4. Adding iBATIS to your application

3.5. iBATIS and JDBC

3.6. iBATIS configuration continued

3.7. Summary