Skip to content

Commit f433acb

Browse files
committed
add mysql and h2 db configurations
1 parent c03902b commit f433acb

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
<artifactId>mysql-connector-java</artifactId>
4545
<scope>runtime</scope>
4646
</dependency>
47+
<dependency>
48+
<groupId>com.h2database</groupId>
49+
<artifactId>h2</artifactId>
50+
<scope>runtime</scope>
51+
</dependency>
4752
<dependency>
4853
<groupId>org.springframework.boot</groupId>
4954
<artifactId>spring-boot-starter-test</artifactId>
Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1+
12
## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)
2-
spring.datasource.url = jdbc:mysql://localhost:3306/notes_app?useSSL=false&serverTimezone=UTC&useLegacyDatetimeCode=false
3-
spring.datasource.username = root
4-
spring.datasource.password = callicoder
53

64

7-
## Hibernate Properties
5+
spring.datasoure.url=hdbc:h2:~/test;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE
6+
spring.datasource.url=jdbc:h2:mem:notes_app
7+
spring.datasource.driverClassName=org.h2.Driver
8+
spring.datasource.username=sa
9+
spring,datasrouce.password=
10+
spring.jpa.datasource-platform=oeg.hibernate.dialect.H2Dialect
811

12+
#spring.datasource.url = jdbc:mysql://127.0.0.1:3306/notes_app?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC&useLegacyDatetimeCode=false
13+
#spring.datasource.username = root
14+
#spring.datasource.password = PASS
915
# The SQL dialect makes Hibernate generate better SQL for the chosen database
10-
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
16+
# spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
17+
18+
19+
20+
## Hibernate Properties
1121

1222
# Hibernate ddl auto (create, create-drop, validate, update)
1323
spring.jpa.hibernate.ddl-auto = update

0 commit comments

Comments
 (0)