Ibator Quick Start Guide

To get up and running quickly with Ibator, follow these steps:

  1. Create and fill out a configuration file appropriately. At a minimum, you must specify:
    1. A <jdbcConnection> element to specify how to connect to the target database
    2. A <javaModelGenerator> element to specify target package and target project for generated Java model objects
    3. A <sqlMapGenerator> element to specify target package and target project for generated SQL map files
    4. (Optionally) A <daoGenerator> element to specify target package and target project for generated DAO interfaces and classes (you may omit the <daoGenerator> element if you don't wish to generate DAOs)
    5. At least one database <table> element

    See the XML Configuration File Reference page for an example of an Ibator configuration file.

  2. Save the file in some convenient location (like \temp\ibatorConfig.xml)
  3. Run Ibator from the command line with a command like this:
    
          java -jar ibator.jar -configfile \temp\ibatorConfig.xml -overwrite
        

    This will tell Ibator to run using your configuration file. It will also tell Ibator to overwrite any existing Java files with the same name. If you want to save any existing Java files, then omit the -overwrite parameter. If there is a conflict, Ibator will save the newly generated file with a unique name (e.g. MyClass.java.1).

  4. After running Ibator, you will need to create or modify the standard iBATIS configuration files to make use of your newly generated code. See the Tasks After Running Ibator page for more information.

Important: Ibator generated code requires that statement namespaces are enabled in your iBATIS configuration. See the Tasks After Running Ibator page for more information.