【ibatis】入门讲例
Ⅰ 、Ibatis项目机构
打开资源包,可以看到里面有一个simple_exzample的文件夹,在MyEclipse8.5中新建一个JAVA项目,将刚才的文件夹中内容复制到项目SRC下,这样的话呢,可以看到这样一个目录
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOgAAACVCAIAAADddyEwAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAUDklEQVR4nO2dfZAU5Z3Hv727CrO7CClesocEEyMUolIYc96SkshpqUjKiEnFXE7Al9xJFMvyIJYi0fhyKvG1KrHqXE8TRCIqMSDKS11dEPQ8OAsSRItoIHHZZdllZ3GHZWFne/p5nvujl+aZ53m6p6dnpnt65vnU1NDP08/veZ6Z/u2vf/30dxqDMba0ZePjC+dAwq3+fx77h7//8S0A0ql0Op1Op1Ijz/rur37y/Vt/vqy7o+e5X61/ePkt3R09615suX/zIdlcoymcOvsfQizDGKpiDADLmINuNoOwMHw6gOFNGA4AeOjGexPAqv9Y/5cDPQAeuPfXk88aA2DhpRe1bNtVyvlrqpQa+59MxjRN0zQH7dfx/qNfJDtdjUwg3cW/Hln9GwB3tvz04eW3AHhu8/J5t30XgNJrDQ6nyG8IzYr4aTUVg2GnCvfPv6ShYSS/4/N9e1r+0P74wjlvvv7C9394K/8OIPnhioH9GxPnzBl78U2/XzLdY4DvPb1bHNIwGGNCDQC+0mkjN9ZowKUKJJXqISTDKKOUDA6cSJ84Zu+yPZV/BzCwf+PEHz7Q9vrDuPim79x5m7LrVCr1wcrVcj1jTPZUN+/UXqtRMuS4fb3J9MAJK2MyRhljVsYkVsbNJrnt6S9fdN5151/w2roHk9ueGXvp4sHPfiG0SaXxwcrVcri10dFUUyBDjvtF8lB/X69lmgwMAGOstrYOaFDaDHT83xlN553c3gEA6TTfIIXhHl4rpK1OgisEYKeZdm6NTB2A5qkTX93ZBgwDhvH7mqdOlA3a3lnaeGYDgIfv/jaAxvEN7e8sHfeVUw1SGOXhtZAcUScJmg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d58PCZG2QUhHPslVERfm9XVkRv4jrKNAB+FGgA8jQGosxQmHRUyHXIiCMUspMd8eV8dCkyzWCuwgbfBuoJD5KhAbKsYSBZEV8BRC/iEsISaV6CMmMHv133YfbbQW6vcuePP9uk6EGIQwAuANHGDMYGBiRllZ43AKh7GGRxDM3d5SfoRvuvEpOzFYVAPT1JtMDJ6yMCaCnq93KmMTKeJtYlkEYO3Ds+CvvfupUEgIYzGAwPX9lKZyCyw1BHAyVm8ptKoD4RVxHgb5t8+pk5wHmQ4FushpbrfvJnrbuVO/l0yYvveESQhkMgBmWS8RVHn7lyd2tRhnzBHE6vyEnpn4yB7lDZId/tzaxJmYRN6gC3aAU4xMNS2+aCWBq0xjCwACDAgZ1W1UQjr1yu5AaZb33QH56yGv0+BKziHvtzPM91mvdsKj9P6EaU8aNBobWdAFQAAzU86cT5UO8nhheamIWcYNBmfHi41fZx/3kE8lh2AWgNiaZn/ZXngrJeDTVRvzWcTUaxFpIrqlm/h+FS8nmZ1z2xAAAAABJRU5ErkJggg==" alt="" width="357" height="229" />
Ⅱ、Ibatis的SQL语句配置类MySqlMapConfig.xml
<span style="font-size: medium;"><?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE sqlMapConfig
PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-config-2.dtd"> <sqlMapConfig>
<transactionManager type="JDBC" commitRequired="false">
<dataSource type="SIMPLE">
<property name="JDBC.Driver" value="com.mysql.jdbc.Driver"/>
<property name="JDBC.ConnectionURL" value="jdbc:mysql://127.0.0.1:3306/ibatis"/>
<property name="JDBC.Username" value="root"/>
<property name="JDBC.Password" value="root"/>
</dataSource>
</transactionManager>
<sqlMap resource="com/mydomain/data/Employee.xml"/> </sqlMapConfig>
</span>
使用的是MySQL数据库,所以要添加数据库驱动包,还有ibatis核心包,在看看数据库表该怎么建立,这得查看下Employee.xml了
Ⅲ、Employee.xml
<span style="font-size: medium;"><?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd"> <sqlMap namespace="Employee"> <typeAlias alias="Employee" type="com.mydomain.domain.Employee"/> <resultMap id="AccountResult" class="Employee">
<result property="id" column="ACC_ID"/>
<result property="firstName" column="ACC_FIRST_NAME"/>
<result property="lastName" column="ACC_LAST_NAME"/>
<result property="emailAddress" column="ACC_EMAIL"/>
</resultMap> <select id="selectAllAccounts" resultMap="AccountResult">
select * from Employee
</select> <select id="selectAccountById" parameterClass="int" resultClass="Employee">
select
ACC_ID as id,
ACC_FIRST_NAME as firstName,
ACC_LAST_NAME as lastName,
ACC_EMAIL as emailAddress
from Employee
where ACC_ID = #id#
</select> <insert id="insertAccount" parameterClass="Employee">
insert into Employee (
ACC_FIRST_NAME,
ACC_LAST_NAME,
ACC_EMAIL
)values (
#firstName#, #lastName#, #emailAddress#
)
</insert> <update id="updateAccount" parameterClass="Employee">
update Employee set
ACC_FIRST_NAME = #firstName#,
ACC_LAST_NAME = #lastName#,
ACC_EMAIL = #emailAddress#
where
ACC_ID = #id#
</update> <delete id="deleteAccountById" parameterClass="int">
delete from Employee where ACC_ID = #id#
</delete> </sqlMap></span>
上面的<ResultMap>标签中有指定每个Account属性对应的数据库的列名,所以就新建数据库了
这样数据建立完成后,我们就可以测试了,这回就用到了SimpleExample.java类了
Ⅳ、SimpleExample.java
package com.mydomain.data; import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;
import com.ibatis.common.resources.Resources;
import com.mydomain.domain.Account; import java.io.Reader;
import java.io.IOException;
import java.util.List;
import java.sql.SQLException; public class SimpleExample { private static SqlMapClient sqlMapper; static {
try {
Reader reader = Resources.getResourceAsReader("com/mydomain/data/MySqlMapConfig.xml");
sqlMapper = SqlMapClientBuilder.buildSqlMapClient(reader);
reader.close();
} catch (IOException e) {
throw new RuntimeException("Something bad happened while building the SqlMapClient instance." + e, e);
}
} public static List selectAllAccounts () throws SQLException {
return sqlMapper.queryForList("selectAllAccounts");
} public static Account selectAccountById (int id) throws SQLException {
return (Account) sqlMapper.queryForObject("selectAccountById", id);
} public static void insertAccount (Account account) throws SQLException {
sqlMapper.insert("insertAccount", account);
} public static void updateAccount (Account account) throws SQLException {
sqlMapper.update("updateAccount", account);
} public static void deleteAccount (int id) throws SQLException {
sqlMapper.delete("deleteAccountById", id);
} }
像上面的增删改查中用到的代替SQL语句的映射KEY,也是可以加上相应的XML文件的配置名称的,如:return sqlMapper.queryForList("Employee.selectAllAccounts")那么这个Account就是Account.xml的名称了
真正想看到测试结果得另写个JUNIT测试类,添加junit的jar包,这里我写了MyTest.java
Ⅴ、MyTest.java
package com.mydomain.data;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List; import org.junit.Test; import com.mydomain.domain.Account; public class MyTest {
@Test
public void selectAllAccounts(){
try {
List list=SimpleExample.selectAllAccounts();
System.out.println(Arrays.toString(list.toArray()));
} catch (SQLException e) {
e.printStackTrace();
}
} public void selectAccountById(){
try {
Account account=SimpleExample.selectAccountById(1);
System.out.println(account);
} catch (SQLException e) {
e.printStackTrace();
}
} public void insertAccount(){
Account account=new Account();
account.setFirstName("tom");
account.setLastName("jam");
account.setEmailAddress("china");
try {
SimpleExample.insertAccount(account);
} catch (SQLException e) {
e.printStackTrace();
}
} public void updateAccount(){
try {
Account account=SimpleExample.selectAccountById(2);
account.setFirstName("gates");
SimpleExample.updateAccount(account);
} catch (SQLException e) {
e.printStackTrace();
}
} public void deleteAccount(){
try {
SimpleExample.deleteAccount(1);
} catch (SQLException e) {
e.printStackTrace();
}
} }
Ⅵ、顺便介绍下MyBatis
MyBatis来源于iBATIS,iBATIS是一个由Clinton Begin在2001年发起的开放源代码项目,iBATIS一词来源于“internet”和“abatis”的组合。该项目最初侧重于密码软件的开发,现在是一个基于Java的持久层框架。iBATIS提供的持久层框架包括SQL Maps和Data Access Objects(DAO),它是著名的ORM开发框架,分为Java和.NET版本,有着众多的追随者。
iBATIS更名为MyBatis并迁移到Google Code,此次项目迁移后,将启用新的网站http://www.mybatis.org/,由于目前只是改了名字,因此仍然可直接浏览iBatis的文档。
MyBatis开发团队希望脱离Apache而独立发展,并保证不会修改授权协议(Apache License)、代码完全兼容、包名不会更改、也不会删除 Apache站上的任何相关资源。改名后的第一次版本MyBatis 3.0.1已经发布,基于iBatis 3.0版本,该版本非常稳定,已经有很多用户使用了数周时间,修复了一些小bug。欲下载 MyBatis 3.0.1请到它新的网站http://www.mybatis.org/。 目前版本是3.0.2
【ibatis】入门讲例的更多相关文章
- Ibatis入门基本语法(转) good
Ibatis入门基本语法 一个项目中在写ibatis中的sql语句时,where user_id in (#user_id_list# ), 运行时总是不行,后来上网查了查,才知道这里不该用#,而应该 ...
- 一个简单的iBatis入门例子
一个简单的iBatis入门例子,用ORACLE和Java测试 目录结构: 1.导入iBatis和oracle驱动. 2.创建类Person.java package com.ibeats;import ...
- Shiro官方快速入门10min例子源码解析框架2-Session
Shiro自身维护了一套session管理组件,它可以独立使用,并不单纯依赖WEB/Servlet/EJB容器等环境,使得它的session可以任何应用中使用. 2-Session)主要介绍在quic ...
- 【OpenFOAM】——OpenFOAM入门算例学习
1 明确目标——为啥费老大劲儿学习OpenFOAM 学习OpenFOAM主要出于课题需要,希望实现以下几个目标: l [ ]学会用SnappyHexMesh生成高质量网格: l [ ]学习使用O ...
- Spring Boot入门样例-001-Java和Maven安装配置
Spring Boot入门样例-001-Java和Maven安装配置 本文说明Java和Maven在windows下的安装和配置 前言 本Spring Boot入门样例准备工作参考: Spring B ...
- DFS 深搜专题 入门典例 -- 凌宸1642
DFS 深搜专题 入门典例 -- 凌宸1642 深度优先搜索 是一种 枚举所有完整路径以遍历所有情况的搜索方法 ,使用 递归 可以很好的实现 深度优先搜索. 1 最大价值 题目描述 有 n 件物品 ...
- jbpm入门样例
1. jBPM的简介 jBPM是JBOSS下的一个开源java工作流项目,该项目提供eclipse插件,基于Hibernate实现数据持久化存储. 參考 http://www.jbos ...
- 转载一篇将C/C++ 与lua混合使用入门讲的比较好的文章
转自 http://www.open-open.com/home/space-6246-do-blog-id-1426.html Lua是一个嵌入式的脚本语言,它不仅可以单独使用还能与其它语言混合调用 ...
- Ibatis入门基本语法
1. Ibatis是开源软件组织Apache推出的一种轻量级的对象关系映射(ORM)框架,和Hibernate.Toplink等在java编程的对象持久化方面深受开发人员欢迎. 对象关系映 ...
随机推荐
- WPF App.xaml.cs常用模板,包括:异常捕获,App只能启动一次
App.xaml.cs中的代码每次都差不多,故特地将其整理出来直接复用: using System; using System.Configuration; using System.Diagnost ...
- 【转】C#中virtual和abstract的区别
virtual和abstract都是用来修饰父类的,通过覆盖父类的定义,让子类重新定义. 它们有一个共同点:如果用来修饰方法,前面必须添加public,要不然就会出现编译错误:虚拟方法或抽象方法是不能 ...
- JVM活学活用——GC算法 垃圾收集器
概述 垃圾收集 Garbage Collection 通常被称为“GC”,它诞生于1960年 MIT 的 Lisp 语言,经过半个多世纪,目前已经十分成熟了. jvm 中,程序计数器.虚拟机栈.本地方 ...
- 「PKUSC2018」最大前缀和(状压dp)
前言 考试被\(hyj\)吊着打... Solution 考虑一下如果前缀和如果在某一个位置的后面的任意一个前缀和都<=0,肯定这就是最大的. 然后这样子就考虑左右两边的状压dp,然后就好了. ...
- Linux学习笔记-基本操作5
1. Linux文件操作相关函数 stat函数 :获取文件属性(从inode上获取) 返回值: 成功:0 ...
- 【tomcat】servlet原理及其生命周期
1.什么是servlet? Servlet(Servlet Applet),全称Java Servlet,是用Java编写的服务器端程序.而这些Servlet都要实现Servlet这个接口.其主要功能 ...
- [Umbraco] 项目结构
主要包括以下几个部分 Umbraco.businesslogic(基础) Umbraco.cms (核心) Umbraco.controls(控件) Umbraco.datalayer(数据) Umb ...
- vue插件ele使用小坑
1.ele-table组件中selection如何默认选中 使用官网提供的api-->>Table Methods中的toggleRowSelection,关于这个api基本介绍就不说了. ...
- Dynamo(Amazon分布式存储引擎)
参考资料: http://blog.csdn.net/zgl_dm/article/details/6291984 http://blog.csdn.net/cywosp/article/detail ...
- 全网最详细的Sublime Text 3的安装Package Control插件管理包(图文详解)
不多说,直接上干货! 全网最详细的Windows里下载与安装Sublime Text *(图文详解) 全网最详细的Sublime Text 3的激活(图文详解) 全网最详细的Sublime Text ...