`
tangxininjava
  • 浏览: 94175 次
  • 性别: Icon_minigender_1
  • 来自: 遂宁
社区版块
存档分类
最新评论

Ibatis2.x学习实战

 
阅读更多

ibatis2.x学习实战

1.到谷歌下载ibatis2.x 包 http://code.google.com/p/mybatis/downloads/detail?name=ibatis-2.3.4.726.zip&can=4&q=

 

2.打开ibatis-2.3.4.726文件夹 

 

 

3.使用simple_example代码

 

4.快速构建自己的工程 (我这里使用myeclipse6.5)

 


 

 

 测试是否成功?

 

 package ibatistest;

import java.sql.SQLException;

import com.mydomain.data.SimpleExample;
import com.mydomain.domain.Account;

public class Test {
	public static void main(String[] args) throws SQLException {
		Account account =  SimpleExample.selectAccountById(2125);
		System.out.println(account.getEmail());
		
	}

}
 

  成功获取email,OK.

 

 附件有代码下载  ibatis2x.rar

 

 

 

  • 大小: 47.3 KB
  • 大小: 60.8 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics