-
ssm+springboot
File–>New–>Project…
Spring Initializr
Maven Project
Web
Web
SQL
mybatis+jdbc+mysql注1:必须配置服务器和数据库相关信息
运行启动入口类的main方法
注:包和类不能乱改
-
配置服务器
server.port=8088
server.servlet.context-path=/s01 -
配置数据库
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/zf?useUnicode=true&characterEncoding=UTF-8
spring.datasource.username=root
spring.datasource.password=123
#spring.jpa.database=mysql
#显示后台处理的SQL语句
#spring.jpa.show-sql=true -
#配置mybatis
#加载映射
mybatis.mapper-locations=classpath*:mapper/*.xml
#配置别名
mybatis.type-aliases-package=com.zking.zf.model注1:使用maven运行mybatis-generator-maven-plugin插件生成Mapper.java和Mapper.xml和之前的配置一样复制即可
ssm+springboot整合
最新推荐文章于 2023-04-01 21:46:21 发布
本文介绍了如何整合SSM(Spring、SpringMVC、Mybatis)和SpringBoot,并提供了详细的配置步骤,包括服务器和数据库的配置。同时,文章讨论了Spring Boot中启用事务管理的注解使用,以及在项目中遇到的数据源自动配置错误和时区识别错误的解决方案。
摘要由CSDN通过智能技术生成