美文网首页coder
springboot Mybatis配置

springboot Mybatis配置

作者: S拒绝拖延 | 来源:发表于2019-07-01 00:13 被阅读0次
# Server Port and Encoding
server:
  port: 8080
  servlet:
    context-path: /springMybatis #配置项目根目录

# Spring Datasource Settings
spring:
  datasource:
    name: druidDataSource
    type: com.alibaba.druid.pool.DruidDataSource
    druid:
      driver-class-name: com.mysql.cj.jdbc.Driver
      url: jdbc:mysql://localhost:3306/hearken5?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&useSSL=false
      username: root
      password: 12345678
      filters: stat
      max-active: 100
      initial-size: 1
      max-wait: 60000
      min-idle: 1
      time-between-eviction-runs-millis: 60000
      min-evictable-idle-time-millis: 300000
      validation-query: select 'x'
      test-while-idle: true
      test-on-borrow: false
      test-on-return: false
      pool-prepared-statements: true
      max-open-prepared-statements: 50
      max-pool-prepared-statement-per-connection-size: 20

# Mybatis config
mybatis:
  mapper-locations: classpath:mapping/*.xml
  type-aliases-package: com.sunsheen.spring_mybatis.business.model #实体所在的包

相关文章

网友评论

    本文标题:springboot Mybatis配置

    本文链接:https://www.haomeiwen.com/subject/bxojcctx.html