MyBatis第一步创建Maven
不用模板
修改id软件的
添加依赖
其中所有内容改为
1 <?xml version="1.0" encoding="UTF-8"?> 2 <project xmlns="http://maven.apache.org/POM/4.0.0" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 5 <modelVersion>4.0.0</modelVersion> 6 7 <groupId>com.itheima</groupId> 8 <artifactId>mybatistest</artifactId> 9 <version>1.0-SNAPSHOT</version> 10 11 <dependencies> 12 <dependency> 13 <groupId>org.mybatis</groupId> 14 <artifactId>mybatis</artifactId> 15 <version>3.5.2</version> 16 </dependency> 17 <dependency> 18 <groupId>mysql</groupId> 19 <artifactId>mysql-connector-java</artifactId> 20 <version>8.0.11</version> 21 </dependency> 22 <dependency> 23 <groupId>junit</groupId> 24 <artifactId>junit</artifactId> 25 <version>4.12</version> 26 <!-- <scope>test</scope>--> 27 <scope>compile</scope> 28 </dependency> 29 </dependencies> 30 <build> 31 <resources> 32 <resource> 33 <directory>src/main/java</directory> 34 <includes> 35 <include>**/*.properties</include> 36 <include>**/*.xml</include> 37 </includes> 38 <filtering>true</filtering> 39 </resource> 40 </resources> 41 </build> 42 43 </project>
再选择查询→新建查询
之后打开Navicat for MySQL
新建连接
name:xxx
密码:1234
右键空白区域新建数据库 数据库名mybatis 字符集utf8 utf-8 排序规则utf8_general
查询代码
use mybatis;
create table users(
uid int primary key auto_increment,
uname varchar(20) not null,
uage int not null
);
insert into users(uid,uname,uage) values(null,'张三',20),(null,'李四',18);
标签:20,框架,uname,查询,mybatis,MyBatis,null From: https://www.cnblogs.com/TokaiTeio32/p/17159124.html