zoukankan      html  css  js  c++  java
  • springboot 常用配置文件

    1.连接数据库

    <dependency>
    <groupId>org.mybatis.spring.boot</groupId>
    <artifactId>mybatis-spring-boot-starter</artifactId>
    <version>1.1.1</version>
    </dependency>

    #MyBatis 映射文件配置  指定mapper包路径
    mybatis.mapper-locations=classpath:com/springboot/mapper/*.xml
    #MyBatis扫描别名包,和 注解@Alias 
    mybatis.type-aliases-package=com.springboot.pojo
    #配置 typeHandler 的扫描包
    mybatis.type- handlers-package=com.springboot.typehandler
    #日志配置
    logging.level.root=DEBUG
    logging.level.org.springframework=DEBUG
    logging.level.org.org.mybatis=DEBUG

    2.连接Redis配置

    <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-redis -->
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-redis</artifactId>
    <version>2.1.3.RELEASE</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
    <dependency>
    <groupId>redis.clients</groupId>
    <artifactId>jedis</artifactId>
    <version>3.1.0-m1</version>
    </dependency>

    ### redis ip地址
    spring.redis.host=127.0.0.1

    ### redis 端口号
    spring.redis.port=6379

    ### redis密码
    spring.redis.password=123456

    ### redis 连接超时时间(单位:毫秒)
    spring.redis.timeout=1000

    ### 连接池最大连接数(如果是负数表示没有限制)
    spring.redis.jedis.pool.max - active=10 

    ### 连接池最大空闲连接数量(如果是负数表示没有限制)
    spring.redis.redis.pool.max-idle=10

    ### redis 最小空闲连接(如果是负数表示没有限制)

    spring.redis.jedis.pool.min-idle=5

    ### 连接池最大阻塞等待时间
    spring.redis.jedis.pool.max-wait=2000

    
    
  • 相关阅读:
    topcoder srm 495 div1
    topcoder srm 500 div1
    topcoder srm 485 div1
    topcoder srm 490 div1
    IDEWorkspaceChecks.plist文件是干什么用的?
    博客推荐
    如何使用U盘安装macOS high Sierra?
    小程序--模板消息调研
    小程序--剖析小程序上传文件
    小程序--小程序开发过程中遇到的问题以及解决方案
  • 原文地址:https://www.cnblogs.com/ming-blogs/p/10709888.html
Copyright © 2011-2022 走看看