首页 > 代码库 > 从ibatis2到mybatis3

从ibatis2到mybatis3

 首先,我们先看差别

技术分享

然后,我们做一个demo。

开发环境:

OS:Windows

IDE: Eclipse IDE for Java Developers

 

1. sql
CREATE TABLE persons (
id int NOT NULL AUTO_INCREMENT ,
name varchar (50) ,
PRIMARY KEY (id))AUTO_INCREMENT=1;

2. java project
(1) Create new Java Project
(2) Add new folder “lib”
(3) Copy mysql-connector-java (jar) and myBatis to “lib” folder
(4)Add jars file to java build path

3. modify config.xml
In the "dataSource", the user name and password, into your own.

 

本文参考:

1. ibatis迁移到mybatis3

2. Java + myBatis + MySql

 

从ibatis2到mybatis3