Skip to content

Instantly share code, notes, and snippets.

@iamitshri
Last active July 7, 2019 19:44
Show Gist options
  • Save iamitshri/dc1b37e10bddc08be267bf11a0f060bd to your computer and use it in GitHub Desktop.
Save iamitshri/dc1b37e10bddc08be267bf11a0f060bd to your computer and use it in GitHub Desktop.
Spring Boot JPA configuration
spring.datasource.url=jdbc:mysql://host:3306/dbname?autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.username=username
spring.datasource.password=password
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=none
spring.jpa.database=mysql
spring.jpa.properties.hibernate.hbm2ddl.auto=none
# setting time zone
spring.jpa.properties.hibernate.jdbc.time_zone=UTC
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
## This is cool, it will output the parameters
logging.level.org.hibernate.type.descriptor.sql=trace
logging.level.org.hibernate.type=trace
spring.jpa.properties.hibernate.generate_statistics=true
logging.level.org.hibernate.stat=debug
# Activate Eager fetching
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment