#springboot-mybatis配置(xml)
spring.datasource.url=jdbc:mysql://localhost:3306/test
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
mybatis.mapper-locations=classpath*:mybatis/*Mapper.xml
mybatis.type-aliases-package=com.forezp.entity

  通过配置mybatis.mapper-locations来指明mapper的xml文件存放位置,我是放在resources/mybatis文件下的。mybatis.type-aliases-package来指明和数据库映射的实体的所在包。

 

springboot-jpa配置

spring.datasource.url=jdbc:mysql://127.0.0.1/test?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC&useSSL=true
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

spring.jpa.properties.hibernate.hbm2ddl.auto=update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.show-sql= true

  

相关文章:

  • 2022-12-23
  • 2021-09-29
  • 2021-12-01
  • 2021-11-18
  • 2021-07-28
  • 2021-07-07
  • 2022-01-14
  • 2022-12-23
猜你喜欢
  • 2021-10-21
  • 2021-05-29
  • 2022-12-23
  • 2021-10-24
  • 2021-06-22
  • 2022-12-23
相关资源
相似解决方案