Creating the DataSource

We configure the DataSource and connection pool in the application.properties. Spring boot uses the spring.datasource interface as a prefix to configure DataSource. Our database schema name is cha6_dbtest_schema. You can create this on your own and rename it. Here are the details of application.properties:

## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
spring.datasource.url = jdbc:mysql://localhost:3306/cha6_dbtest_schema?useSSL=false
spring.datasource.username = root
spring.datasource.password = 12345678


## Hibernate Properties
# The SQL dialect makes Hibernate generate better SQL for the chosen database
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect

# Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto = update

In our system, the MySQL details are as follows: