mybatis

MyBatis 本是apache的一个开源项目iBatis, 2010年这个项目由apache software foundation 迁移到了google code,并且改名为MyBatis。是一个基于Java的持久层框架

ORM框架  都是对JDBC的一种封装!

Objet Relation Mapping

  • Hibernate。   v
  • jdbc          v
  • SpringDAO.   没学

 Mybatis就是jdbc和Hibernate之间的一个平衡点...毕竟现在业界都是用这个框架,我们也不能不学呀!

nessarary

Mybatis开发包

Mysql数据库开发包。

建表

create table students(
  id  int(5) primary key,
  name varchar(10),
  sal double(8,2)
);

 

建类

/**
 * Created by ozc on 2017/7/21.
 */

public class Student {
    private Integer id;
    private String name;
    private Double sal;

    public Student() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getSal() {
        return sal;
    }

    public void setSal(Double sal) {
        this.sal = sal;
    }
}

 

posted on 2019-07-23 18:12  LittleSpring  阅读(125)  评论(0编辑  收藏  举报