Skip to content

Instantly share code, notes, and snippets.

@ggordonutech
Created October 31, 2019 02:23
Show Gist options
  • Save ggordonutech/fb609696610b49c13538ccd3e5f9f3c4 to your computer and use it in GitHub Desktop.
Save ggordonutech/fb609696610b49c13538ccd3e5f9f3c4 to your computer and use it in GitHub Desktop.
Default Springboot MVC application properties with Mysql/Sqlite Support
# RUN THE SERVER ON PORT 8090
server.port = 8090
# DataSource settings: set here your own configurations for the database
# connection. In this example we have "fruitdb" as database name and
# "root" as username and password.
# ---- USE LINE BELOW FOR MYSQL
spring.datasource.url = jdbc:mysql://localhost:3306/fruitdb?useSSL=false&createDatabaseIfNotExist=true
spring.datasource.username = root
spring.datasource.password = password
#spring.datasource.url = jdbc:sqlite:fruitcomments.sqlite
# Keep the connection alive if idle for a long time (needed in production)
spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1
# 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
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
# Use spring.jpa.properties.* for Hibernate native properties (the prefix is
# stripped before adding them to the entity manager)
# The SQL dialect makes Hibernate generate better SQL for the chosen database
# ---- USE LINE BELOW FOR MYSQL
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.SQLiteDialect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment