Skip to content

[xxx] 关于混合持久化,多数据源的问题,同时使用MySQL和SQL Server,出现一些不兼容的情况 #840

Description

@AFatFox

Description

基于apijson-demo-druid,想实现通过前端控制切换不同数据库类型。实现如下:编写MySQL以及SQLServer配置,通过DemoDataSourceConfig注入MySQL和SQLServer的DruidDataSource,DemoSQLConfig配置的是SQLServer的,并改了一下DemoSQLExecutor的getConnection方法,根据apijson-boot-multi-datasource中对应的方法来改的。在请求时通过@Datasource指定不同数据源,请求SQLServer的没问题,切换到MySQL时,控制台提示SQL异常,虽然确实是通过MYSQL执行的,但是语句格式还是使用的SQLServer的,请问这是我哪里编写的问题吗?

apiJson版本:7.1.5
MySQL:8.0.24
SQLServer:2022
JDK:21
windows 10

下面是配置
Image

下面是DemoDataSourceConfig
Image

下面是DemoSQLConfig
Image

下面是DemoSQLExecutor
Image

控制台异常信息:
Image

请求截图:
Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions