Creating 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 packtpub_dbtest_schema. You can create this on your own and rename it. Here are the details of application.properties:

# Database Configuration

spring.datasource.url=jdbc:mysql://localhost:3306/packtpub_dbtest_schema
spring.datasource.username=root
spring.datasource.password=12345678

According to the previous code, spring.datasource.url=jdbc:mysql:
//localhost:3306/packtpub_dbtest_schema means the URL for the database schema called packtpub_dbtest_schema to access the data in the project. spring.datasource.username=root means the username of the database is root, and spring.datasource.password=12345678 means the username of the database is 12345678.

In our system, the MySQL details are as follows:

Host -- localhost                                    // the host URL
Port -- 3306 // the host POST number
Username -- root // the username of the database
Password -- 12345678 // the password of the database
Database Name - packtpub_dbtest // the Database name
Database Schema Name - packtpub_dbtest_schema // the Database Schema name
..................Content has been hidden....................

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