-
DB연결 디펜던시, application 설정java/SpringBoot 2022. 8. 4. 02:34728x90
생성 했을때 프로젝트 설정 그대로 기억 해두는게 좋겠다 그래야 디펜던시 찾기 편함
mybatis와 mariadb를 사용 할 거니까 얘들 디펜던시 가져온당
//build.gradle dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat' testImplementation 'org.springframework.boot:spring-boot-starter-test' // https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-jasper implementation 'org.apache.tomcat.embed:tomcat-embed-jasper' developmentOnly 'org.springframework.boot:spring-boot-devtools' implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2' runtimeOnly 'org.mariadb.jdbc:mariadb-java-client' }
//application.properties # mariaDB spring.datasource.driverClassName=org.mariadb.jdbc.Driver spring.datasource.url=jdbc:mariadb://디비/주소 spring.datasource.username=이름 spring.datasource.password=비밀번호
//application.properties mybatis.mapper-locations=classpath:mapper/*.xml
mapper가 생성되는 경로를 properties에 추가 해줘야함!
728x90'java > SpringBoot' 카테고리의 다른 글
application.properties - application.yml 환경설정파일 (0) 2022.08.07 resultMap , mapUnderscoreToCamelCase (0) 2022.08.05 Lombok 사용하기 (0) 2022.08.05 Controller,View 생성 (0) 2022.08.04 스프링부트로 프로젝트를 하게 되었다... feat. 노드 하고 싶은데... (0) 2022.08.03