zoukankan      html  css  js  c++  java
  • SpringBoot:阿里数据源配置、JPA显示sql语句、格式化JPA查询的sql语句

    1 数据源和JPA配置

      1.1 显示sql配置和格式化sql配置

        者两个配置都是属于hibernate的配置,但是springdatajpa给我们简化了;所有hibernate的配置都在jpa下面的properties中;若果直接配置到jpa下面可能不会生效

    eureka:
      client:
        service-url:
          defaultZone: http://localhost:8761/eureka/  # 注册中心
      instance:
        hostname: productClient
    spring:
      application:
        name: product
    
      datasource:
        url: jdbc:mysql://xxxxx:3306/spring_cloud_sell?useUnicode=true&characterEncoding=UTF-8&useSSL=false
    #    url: jdbc:mysql://xxxxx:3306/dev?useUnicode=true&characterEncoding=UTF-8&&useSSL=false
    #    url: jdbc:mysql://xxxxx:3306/qcbx?useUnicode=true&characterEncoding=UTF-8&&useSSL=false
        driver-class-name: com.mysql.jdbc.Driver
    #    username: root
    #    password: uAiqwVwjJ8-i
        username: dev
        password: Dev-182838
      jpa:
        properties:
              hibernate:
                format_sql: true
                show_sql: true
    View Code

      

  • 相关阅读:
    python 按行读取判断是否为空
    python获取目录下所有文件
    Kolakoski
    最小背包问题
    python 求第k个最大数
    python 求最大子序列
    爬取数据的程序
    文件对比程序
    trsd_extract_EDSD_new
    tred_extract_EDED_new
  • 原文地址:https://www.cnblogs.com/NeverCtrl-C/p/9355293.html
Copyright © 2011-2022 走看看