# 当前运行环境
spring:
profiles:
active: dev
# 配置 mybatis xml 保存路径
mybatis:
mapper-locations: classpath:mybatis/**Mapper.xml
# 连接数据库
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/_table?characterEncoding=utf8&&useSSL=false
username: root
password: 12345678
driver-class-name: com.mysql.cj.jdbc.Driver # 这里表示 MySQL 驱动名称
# 开启 MyBatis SQL 打印
logging:
level:
com:
example:
demo: debug
mybatis:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="">
<select id="" resultType=""> select>
mapper>
① " namespace " 属性,填入的是 Mapper 接口。( 需要具体到包名、接口名 )
② 在上面的 select 标签中," id " 属性表示 Mapper 接口中的方法名;" resultType" 属性表示当前查询操作返回的类型 ( 需要具体到包名、实体类名 )
DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Archetype Created Web Applicationdisplay-name>
web-app>
<dependencies>
<dependency>
<groupId>javax.servletgroupId>
<artifactId>javax.servlet-apiartifactId>
<version>3.1.0version>
<scope>providedscope>
dependency>
<dependency>
<groupId>mysqlgroupId>
<artifactId>mysql-connector-javaartifactId>
<version>5.1.47version>
dependency>
<dependency>
<groupId>com.fasterxml.jackson.coregroupId>
<artifactId>jackson-databindartifactId>
<version>2.12.7version>
dependency>
dependencies>
<packaging> war packaging>
<build>
<finalName> blog_system_changefinalName>
build>