인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

shabeltiger's profile image
shabeltiger

asked

Spring Boot Introduction by Example

(13) JdbcTemplate Basics

mysql 로 연결할려면 어떻게 해요?

Written on

·

242

2

오라클 대신에 mysql 써야 하는데 자꾸 에러 나고 안돼요.

디펜던시에 아래같이 넣어 줬어요.

    implementation "mysql:mysql-connector-java:5.1.46"    

    implementation "org.springframework.boot:spring-boot-starter-jdbc:2.0.1.RELEASE"    

implementation 'org.apache.tomcat.embed:tomcat-embed-jasper'

implementation 'javax.servlet:jstl'    

spring-boot

Answer 1

1

java님의 프로필 이미지
java
Instructor

build.gradle 의 jdbc 세팅

-------------------------

implementation("org.springframework.boot:spring-boot-starter-jdbc")

implementation("mysql:mysql-connector-java")

 

application.properties 에서 데이터베이스 접속 내용

--------------------------------------------------

spring.datasource.driver-class-name=com.mysql.jdbc.Driver

spring.datasource.url=jdbc:mysql://localhost:3306/데이터베이스명

spring.datasource.username=유저

spring.datasource.password=패스워드

 

이렇게 설정해 주시면 됩니다.

 

shabeltiger's profile image
shabeltiger

asked

Ask a question