springboot配置多数据源MySQL和Oracle区别

MySQL和Oracle配置大致一样,但是Oracle是url,而MySQL是jdb-url

datasource:
        databaseFirst:
            auto-commit: false
            driver-class-name: oracle.jdbc.OracleDriver
            url: jdbc:oracle:thin:@xxx.xxx.xxx.xxx:port:databaseName
            username: username
            password: password
            type: com.zaxxer.hikari.HikariDataSource
            hikari:
                auto-commit: false
                data-source-properties:
                    cachePrepStmts: true
                    prepStmtCacheSize: 250
                    prepStmtCacheSqlLimit: 2048
                    useServerPrepStmts: true
        databaseSecond:
            auto-commit: false
            driver-class-name: com.mysql.jdbc.Driver
            jdbc-url: jdbc:mysql://xxx.xxx.xxx.xxx:3306/databaseName?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
            username: username
            password: password
            type: com.zaxxer.hikari.HikariDataSource
            hikari:
                auto-commit: false
                data-source-properties:
                    cachePrepStmts: true
                    prepStmtCacheSize: 250
                    prepStmtCacheSqlLimit: 2048
                    useServerPrepStmts: true

你可能感兴趣的:(springboot配置多数据源MySQL和Oracle区别)