Springboog集成oracle数据源(原先已经配置druid项目可以跑起来)

1:集成坐标

<dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc6</artifactId>
        <version>11.2.0.1.0</version>
</dependency>

  1. 配置数据源

    spring:
        datasource:
            driver-class-name: oracle.jdbc.driver.OracleDriver
            initial-size: 5
            max-idle: 10
            max-wait: 10000
            min-idle: 5
            password: root
            url: jdbc:oracle:thin:@127.0.0.1:1521/tbase
            username: root
    
    
    

    3.测试,mybatis-puls

    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE mapper
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
    
    <mapper namespace="com.protal.information.mapper.UserMapper">
     <select id="findUserByName" resultType="java.lang.String" >
         SELECT FCONSUNITNAME FROM CEV_BADBEHAVIOR WHERE FBID = '8a8180c765a70dbf0165a899ede50099'
        </select>
    

</mapper>


4.附件 oracle链接jar
 
  转自:https://www.jianshu.com/p/12bebad59235