刚刚接触springboot,对很多东西都不熟悉,例如,它的注解方式,他的配置方式等;听说它很牛逼,所以就尝试着去学习。在基本熟悉springboot的第一个程序之后。想到当时spring整合mybatis时使用了数据源连接数据库,所以自己也想尝试使用c3p0连接数据库。所以就有了以下的内容:
首先第一步,创建maven项目导入包:
pom.xml
org.springframework.boot
spring-boot-starter-parent
1.4.1.RELEASE
junit
junit
4.12
test
org.springframework.boot
spring-boot-starter-test
1.4.1.RELEASE
org.springframework.boot
spring-boot-starter-web
1.4.1.RELEASE
org.mybatis.spring.boot
mybatis-spring-boot-starter
1.1.1
mysql
mysql-connector-java
5.1.33
c3p0
c3p0
0.9.1.2
org.springframework.boot
spring-boot-maven-plugin
应用服务类
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.b