Skip to content

Commit 144a01d

Browse files
committed
[FIX] DB 연결
1 parent 6cdcf2b commit 144a01d

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

build.gradle

+4-3
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ dependencies {
4141
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'
4242

4343
//h2 적용
44-
implementation 'com.h2database:h2'
44+
//implementation 'com.h2database:h2'
4545

46-
//db 연결
4746
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
48-
runtimeOnly 'mariadb.jdbc:mariadb-java-client'
47+
//implementation 'org.mariadb.jdbc:mariadb-java-client:3.0.7'
48+
implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '3.0.7'
49+
4950

5051
//websocket 설정
5152
implementation 'org.springframework.boot:spring-boot-starter-websocket'

src/main/java/kbsc/kbsc/infra/H2ServerConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package kbsc.kbsc.infra;
1+
/*package kbsc.kbsc.infra;
22
33
import com.zaxxer.hikari.HikariDataSource;
44
import org.h2.tools.Server;
@@ -15,4 +15,4 @@ public DataSource dataSource() throws SQLException {
1515
Server.createTcpServer("-tcp", "-tcpAllowOthers", "-tcpPort", "9092").start();
1616
return new HikariDataSource();
1717
}
18-
}
18+
}*/

src/main/resources/application.properties

+12-3
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,23 @@ org.hibernate.dialect.MariaDB53Dialect
1212
#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
1313
spring.batch.jdbc.initialize-schema=always
1414

15-
15+
# db ??
16+
#spring.datasource.url=jdbc:mysql://?????:3306/db??(myselectshop)
17+
#spring.datasource.username=?????
18+
#spring.datasource.password=????
19+
#spring.jpa.hibernate.ddl-auto=update
20+
#useSSL=false
21+
#jdbc:mariadb://kbsc-springboot-werbservice.cw5x2rozed2v.ap-northeast-2.rds.amazonaws.com:3306/kbsc_rds
1622
spring.datasource.jdbc-url=jdbc:mariadb://kbsc-springboot-werbservice.cw5x2rozed2v.ap-northeast-2.rds.amazonaws.com:3306/kbsc_rds?useSSL=false
17-
spring.datasource.username= admin
18-
spring.datasource.password= akdrh0218
23+
spring.datasource.username=admin
24+
spring.datasource.password=akdrh0218
25+
spring.datasource.driverClassName=org.mariadb.jdbc.Driver
1926
spring.jpa.hibernate.ddl-auto=update
2027

28+
# JPA nameStrategy ??
2129
spring.jpa.hibernate.naming.physical-strategy = org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
2230

31+
# sql ?? ?? ??
2332
logging.level.org.hibernate.SQL=DEBUG
2433
spring.jpa.properties.hibernate.format_sql=true
2534
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE

0 commit comments

Comments
 (0)