After identifying the appropriate DataSource
implementation, we are now ready to establish the database transactions in our Spring MVC application.
Open again the ch03-jdbc
project and verify if MySQL 5.7 is updated and working fine. Also, check again if the DataSource
implementation is appropriate for your application.
It is always the best practice to design the database and table schemas using an ERD model. After finalizing our schema designs, follow these steps to build our DAO layer:
- Let us open a MySQL workbench or a command line terminal, log in using the
username
root
andpassword
spring5mysql
, and create the following schema definition of thehrs
database: - Since we will be dealing with database models, create a package,
org.packt.dissect.mvc.model.data
, that will contain data models representing the schema of the preceding tables. Given the two tables, create theEmployee
andDepartment
data models...