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:

  • Host -- localhost
  • Port -- 3306
  • Username -- rootPassword -- 12345678
  • Database Name - packtpub_dbtest
  • Database Schema Name - packtpub_dbtest_schema
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.71.115