zoukankan      html  css  js  c++  java
  • application.properties文件配置

      在application.properties文件中配置mysql连接配置文件。

    spring.datasource.url = jdbc:mysql://localhost:3306/DatebaseName(自己数据库名)
    spring.datasource.username = root
    spring.datasource.password = 123
    spring.datasource.driverClassName = com.mysql.jdbc.Driver
    spring.datasource.max-active=20
    spring.datasource.max-idle=8
    spring.datasource.min-idle=8
    spring.datasource.initial-size=10

      在application.properties文件中配置JPA配置信息。

    # Specify the DBMS
    spring.jpa.database = MYSQL
    # Show or not log for each sql query
    spring.jpa.show-sql = true
    # Hibernate ddl auto (create, create-drop, update)
    spring.jpa.hibernate.ddl-auto = update
    # Naming strategy
    #[org.hibernate.cfg.ImprovedNamingStrategy #org.hibernate.cfg.DefaultNamingStrategy]
    spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
    # stripped before adding them to the entity manager)
    spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect

       在application.properties文件中的服务器配置

    server.port=8080 #端口号设置
    server.servlet.context-path=/exam #访问路径设置

  • 相关阅读:
    Spring入门
    排序算法【整理】
    C#并发解决(lock)
    Java poi导出word表格
    layui table checkbox默认选中
    Element table表尾合计行嵌入input
    Java接收带List的实体类
    Web SQL Database+mui上传视频
    Web SQL Database+mui上传图片
    mui 上传视频
  • 原文地址:https://www.cnblogs.com/yuanxls/p/11238391.html
Copyright © 2011-2022 走看看