最近有一个新项目需要开发搭建了个SpringBoot框架 记录一下!
Oracle连接jar编译到maven仓库参考:Maven编译jar包到本地仓库
1、SpringBoot版本:
2.1.6.RELEASE
2、pom配置
<!-- jdbc配置 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <!-- web --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!-- druid连接池 --> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.1.10</version> </dependency> <!-- Oracle 驱动包 自行下载编译到maven仓库 --> <dependency> <groupId>org.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.2.0.2.0</version> </dependency> <!-- Mybatis配置 --> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.0.1</version> </dependency> <!-- AOP配置 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency> <!-- log4j日志配置 --> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency>
3、Druid配置
Druid配置类
package com.jst.tjgx.supervisionservice.datasource; import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.support.http.StatViewServlet; import com.alibaba.druid.support.http.WebStatFilter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springfram
SpringBoot+Druid+Mybatis连接Oracle
最新推荐文章于 2024-07-16 22:44:16 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)