利用ibatis 自动生成文件

来源:互联网 发布:sql是什么 编辑:程序博客网 时间:2024/05/16 06:14

一、eclipse install plugin Error Error retrieving "feature.xml". [error in opening zip file]-

 

错误解决办法:

删除eclipse 根目录下的site.xml,然后重新启动eclipse.

没有这个错误,跳过。

 

二、eclipse上安装abator插件

l  eclipse菜单栏 --> help --> Software Updates --> Find And Install...

l  对话框中选择 “Search for new features to install” 然后点击 “next”

l  在对话框中点击按钮 New Remort Site...  在弹出的对话框中的URL输入框中填写 http://ibatis.apache.org/tools/abator

l  点击Finish,安装插件,然后重新启动eclipse

一、测试

l  新建一个工程,必须是java工程。

l  新建一个ibatis配置文件 File-->Abator for ibatis ...

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE abatorConfiguration PUBLIC "-//Apache Software Foundation//DTD Abator for iBATIS Configuration 1.0//EN" "http://ibatis.apache.org/dtd/abator-config_1_0.dtd" >
<abatorConfiguration >
  <abatorContext >
    <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://192.168.1.117:3306/uniscode?useUnicode=true&amp;characterEncoding=utf-8" userId="root" password="123456" >
      <classPathEntry location="G:/qcms_ext/uMa/WebContent/WEB-INF/lib/mysql-connector-java-3.1.13-bin.jar" />
    </jdbcConnection>
    <javaModelGenerator targetPackage="com.test" targetProject="autoTest" />
    <sqlMapGenerator targetPackage="com.test" targetProject="autoTest" />
    <daoGenerator targetPackage="com.test" targetProject="autoTest" type="GENERIC-CI" />
    <table schema="uniscode" tableName="%" >
    
    </table>
  </abatorContext>
</abatorConfiguration>

 

 

 

 

原创粉丝点击