1.依賴:

2.配置問題:
大家都知道,springBoot的有點就是解決了各種xml的配置問題

3.

這個問題很簡單,但是讓我找了很長時間:
spring注入,之前用ssm框架的時候,需要些spring的配置文件,ComponentScan配置可以掃描到的地方,這里找不到service,是因為service的實現(xiàn)類沒有使用@Component注解,創(chuàng)建不出來.加上就好了
切記dao層也要加上呀...否則不能注入.
啟動成功了!


正確的:
spring.datasource.username=###
spring.datasource.password=###
