我的笔记
有道云笔记 https://note.youdao.com/s/SiWk4eFN
模块准备工作
新建一个java项目
打开这个项目之后新建新模块
其他文件配置
1.创建数据库,创建数据表,插入数据
create database data1;
use data1;
create table student(
id int primary key auto_increment,
name varchar(20),
age int
);
insert into student values (null,'Anna',11);
insert into student values (null,'Bill',12);
insert into student values (null,'Clark',15);
insert into student values (null,'Dell',12);
2.Idea连接数据库
3.创建学生实体类
里面有成员变量 id name age
4.编写配置文件
在src根目录下创建一下四个目录
jdbc.properties log4j.properties MyBat isConfig.xml StudentMapper.xml
文件配置信息(老师教案)有道云笔记
MyBatisConfig.xml StudentMapper.xml 这两个文件中需要写上根标签