---
title: "Ibaits实现CRUD之二"
author: "changong"
date: "2009-08-05T23:01:47Z"
tags: ["Bean", "DAO", "SQL", "XML", "iBATIS"]
slug: "ibaits-crud"
draft: false
lastmod: "2009-08-05T23:01:47Z"
id: 441079
url: "https://changong.iteye.com/blog/441079"
---

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

**该篇主要编写bean和ibaits实现的DAO层代码。**

**在src下创建包**com.zyg.ssi.bean,**在该包下创建bean类Students，其代码如下：**

  

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

     

     

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

       **在src下创建包com.zyg.ssi.dao，在该包下创建实现针对Student的CRUD操作的接口StudentDao，其代码如下：**

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

  

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