`
changong
  • 浏览: 58820 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Ibaits实现CRUD之二

阅读更多

转载请注明:来自http://changong.iteye.com/作者:张燕广

该篇主要编写beanibaits实现的DAO层代码。

src下创建包com.zyg.ssi.bean,在该包下创建beanStudents,其代码如下:

  

      sqlmap-config.xml的配置中引用了Studentxml配置,在该包下创建Student.xml配置文件,其代码如下:

     

     

sqlmap-config.xml的配置中引用了Studentxml配置,在该包下创建Student.xml配置文件,其代码如下:

       src下创建包com.zyg.ssi.dao在该包下创建实现针对StudentCRUD操作的接口StudentDao,其代码如下:

     src下创建包com.zyg.ssi.dao.ibaits在包下创建接口StudentDao的实现类StudentDaoImpl,其代码如下:

  

   至此,通过ORM框架iBaits实现的CRUD操作已完成,下一篇编写Junit测试类进行单元测试。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics