Skip to content

OceanBase 数据库适配

James 配置修改

James 中涉及数据库配置的配置文件 conf/james-database.properties

调整配置后需 将 OceanBase 对应的驱动包放入 lib 文件夹 中,否则启动会报驱动找不到的错

James 没有兼容 OceanBase,但是我们可以通过使用 OceanBase 兼容 MySQL 的特性实现间接的兼容

properties
database.driverClassName=com.alipay.oceanbase.jdbc.Driver
database.url=jdbc:oceanbase://localhost:2881/james
database.username=root@test
database.password=111111

vendorAdapter.database=MYSQL

webmail 配置修改

配置文件所在位置 risenet-y9boot-webapp-webmail/src/main/resources/application.yml

yaml
spring:
    datasource:
        druid:
            y9-public:
                driver-class-name: com.alipay.oceanbase.jdbc.Driver
                url: jdbc:oceanbase://localhost:2881/y9_public  
                username: root@test
                password: 111111
            webmail:
                # 连接 james 的库,用于邮箱的管理
                driver-class-name: com.alipay.oceanbase.jdbc.Driver
                url: jdbc:oceanbase://localhost:2881/james
                username: root@test
                password: 111111
    jpa:
        #修改为 MySQL 版本对应的方言
        database-platform: org.hibernate.dialect.MySQL8Dialect
        properties:
            hibernate:
                #修改为 MySQL 版本对应的方言
                dialect: org.hibernate.dialect.MySQL8Dialect

Released under the GPL-3.0 License.