mirror of
https://github.com/JeffLi1993/springboot-learning-example.git
synced 2026-03-13 21:43:45 +08:00
Springboot 整合 Mybatis 的完整 Web 案例
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
## 数据源配置
|
||||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/springbootdb?useUnicode=true&characterEncoding=utf8
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=123456
|
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||
|
||||
## Mybatis 配置
|
||||
mybatis.typeAliasesPackage=org.spring.springboot.domain
|
||||
mybatis.mapperLocations=classpath:mapper/*.xml
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE configuration
|
||||
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||
<configuration>
|
||||
<typeAliases>
|
||||
<package name="org.spring.springboot.domain"/>
|
||||
</typeAliases>
|
||||
<mappers>
|
||||
<mapper resource="mapper/CityMapper.xml"/>
|
||||
</mappers>
|
||||
</configuration>
|
||||
Reference in New Issue
Block a user