Explanation of creating java REST Api, HTTP POST Method using spring boot,jpa,mysql.
Connect to multiple DB: https://stackoverflow.com/questions/4...
application.properties file for copy paste for mysql db:
server.port = 9090
spring.datasource.url = jdbc:mysql://localhost:3306/spring_projects
spring.datasource.username = root
spring.datasource.password = root
#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.hibernate.ddl-auto = update
For Postgres:
DataSourceAutoConfiguration & DataSourceProperties
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres_db
spring.datasource.username= root
spring.datasource.password= root
The SQL dialect makes Hibernate generate better SQL for the db
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto = update
GitHub Link to the project: https://github.com/vkrvikash/demo
コメント