整合到applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<import resource="classpath:spring/spring-dao.xml"/>
<import resource="classpath:spring/spring-service.xml"/>
<import resource="classpath:spring/spring-mvc.xml"/>
</beans>
database.properties
jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/sims?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
jdbc.user=root
jdbc.password=
mybatis-config.xml
<?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="com.lyq.pojo"/>
</typeAliases>
<mappers>
<mapper class="com.lyq.dao.STUMapper"/>
<mapper class="com.lyq.dao.CourseMapper"/>
<mapper class="com.lyq.dao.ClassMapper"/>
<mapper class="com.lyq.dao.TeacherMapper"/>
<mapper class="com.lyq.dao.UserMapper"/>
<mapper class="com.lyq.dao.GradeMapper"/>
</mappers>
</configuration>
关系: