springboot项目搭建
新建项目
1.包名:cy.store
2.导入依赖:![]()
3.在properties中配置:
spring.datasource.username=root
spring.datasource.password=aa123456
spring.datasource.url=jdbc:mysql://localhost:3306/house?useSSl=true&useUnicode=true&characterEncoding=UTF-8
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
#整合mybatis
#mybatis.type-handlers-package=com.example.pojo
#mybatis.mapper-locations=classpath:mybatis/mapper/*.xml
4.创建数据库:
可视化界面创建即可
5.链接数据库
1.先运行主类看一看有没有springboot编制标志
2.在test中测试,自动装配datasorce
6.加载静态资源
直接放在static当中,你放在thymleaf需要controller跳转的
1.maven : clear install
2.重启idea


浙公网安备 33010602011771号