增加项目说明
This commit is contained in:
@@ -3,8 +3,6 @@ package com.heibaiying.springboot.dao;
|
||||
import com.heibaiying.springboot.bean.Programmer;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : heibaiying
|
||||
*/
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.heibaiying.springboot.dao;
|
||||
import com.heibaiying.springboot.bean.Programmer;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : heibaiying
|
||||
*/
|
||||
|
||||
@@ -1,55 +1,55 @@
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:3306/mysql?useUnicode=true&characterEncoding=utf-8
|
||||
url: jdbc:mysql://127.0.0.1:3306/mysql?characterEncoding=UTF-8&serverTimezone=UTC&useSSL=false
|
||||
username: root
|
||||
password: root
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
# 如果不想配置数据源的话,以下关于连接池的配置就不是必须的
|
||||
# spring-boot 2 默认采用高性能的 Hikari 作为连接池 更多配置可以参考 https://github.com/brettwooldridge/HikariCP#configuration-knobs-baby
|
||||
# 如果不想配置对数据库连接池做特殊配置的话,以下关于连接池的配置就不是必须的
|
||||
# spring-boot 2 默认采用高性能的 Hikari 作为连接池 更多配置可以参考 https://github.com/brettwooldridge/HikariCP#configuration-knobs-baby
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
hikari:
|
||||
# 池中维护的最小空闲连接数
|
||||
# 池中维护的最小空闲连接数
|
||||
minimum-idle: 10
|
||||
# 池中最大连接数,包括闲置和使用中的连接
|
||||
# 池中最大连接数,包括闲置和使用中的连接
|
||||
maximum-pool-size: 20
|
||||
# 此属性控制从池返回的连接的默认自动提交行为。默认为true
|
||||
# 此属性控制从池返回的连接的默认自动提交行为。默认为true
|
||||
auto-commit: true
|
||||
# 允许最长空闲时间
|
||||
# 允许最长空闲时间
|
||||
idle-timeout: 30000
|
||||
# 此属性表示连接池的用户定义名称,主要显示在日志记录和JMX管理控制台中,以标识池和池配置。 默认值:自动生成
|
||||
# 此属性表示连接池的用户定义名称,主要显示在日志记录和JMX管理控制台中,以标识池和池配置。 默认值:自动生成
|
||||
pool-name: custom-hikari
|
||||
#此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
|
||||
#此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
|
||||
max-lifetime: 1800000
|
||||
# 数据库连接超时时间,默认30秒,即30000
|
||||
# 数据库连接超时时间,默认30秒,即30000
|
||||
connection-timeout: 30000
|
||||
# 连接测试sql 这个地方需要根据数据库方言差异而配置 例如 oracle 就应该写成 select 1 from dual
|
||||
# 连接测试sql 这个地方需要根据数据库方言差异而配置 例如 oracle 就应该写成 select 1 from dual
|
||||
connection-test-query: SELECT 1
|
||||
|
||||
# mybatis 相关配置
|
||||
# mybatis 相关配置
|
||||
mybatis:
|
||||
# 指定 sql xml 文件的位置
|
||||
# 指定 sql xml 文件的位置
|
||||
mapper-locations: classpath*:mappers/*.xml
|
||||
configuration:
|
||||
# 当没有为参数提供特定的 JDBC 类型时,为空值指定 JDBC 类型。
|
||||
# oracle数据库建议配置为JdbcType.NULL, 默认是Other
|
||||
# 当没有为参数提供特定的 JDBC 类型时,为空值指定 JDBC 类型。
|
||||
# oracle数据库建议配置为JdbcType.NULL, 默认是Other
|
||||
jdbc-type-for-null: 'null'
|
||||
# 是否打印sql语句 调试的时候可以开启
|
||||
# 是否打印sql语句 调试的时候可以开启
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
||||
|
||||
# 注 1
|
||||
# 注 1
|
||||
# oracle
|
||||
# driver="oracle.jdbc.driver.OracleDriver"
|
||||
# url="jdbc:oracle:thin:@localhost:1521:数据库名"
|
||||
# url="jdbc:oracle:thin:@localhost:1521:数据库名"
|
||||
# mysql
|
||||
# driver="com.mysql.jdbc.Driver"
|
||||
# url="jdbc:mysql://localhost/数据库名?[后接参数]"
|
||||
# driver="com.mysql.cj.jdbc.Driver"
|
||||
# url="jdbc:mysql://localhost/数据库名?[后接参数]"
|
||||
|
||||
|
||||
# 注 2
|
||||
# mybatis 配置更多说明可以参考settings http://www.mybatis.org/mybatis-3/zh/configuration.html
|
||||
# 注 2
|
||||
# mybatis 配置更多说明可以参考settings http://www.mybatis.org/mybatis-3/zh/configuration.html
|
||||
|
||||
|
||||
# 注 3
|
||||
# spring boot 2.0 默认采用Hikari 作为连接池 github地址 https://github.com/brettwooldridge/HikariCP
|
||||
# 注 3
|
||||
# spring boot 2.0 默认采用Hikari 作为连接池 Hikari github地址 https://github.com/brettwooldridge/HikariCP
|
||||
Reference in New Issue
Block a user