Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JPAMysqlExample

Example of the JPA and Mysql Database integration

In this example, a database ("example_mysql") is created based on Msql

The fundamental classes are

  • Student
  • StudentInterface
  • DataLoader

The Student class is in charge of representing the model

The StudentInterface is in charge of create the JPA repository

The DataLoader class is in charge of populating the BD

The configuration of the connection with the mysql db is defined in the appliction properties file

  • spring.datasource.url=jdbc:mysql://localhost:3306/mysql_example?serverTimezone=UTC
  • spring.datasource.username=root
  • spring.datasource.password=
  • spring.jpa.hibernate.ddl-auto=create-drop
  • spring.jpa.show-sql=true

The final result is the creation and insertion of data in the student table

About

Example of the JPA and Mysql Database integration

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages