baomidou / dynamic-datasource

dynamic datasource for springboot 多数据源 动态数据源 主从分离 读写分离 分布式事务
https://www.kancloud.cn/tracy5546/dynamic-datasource/2264611
Apache License 2.0
4.67k stars 1.19k forks source link

多数据源不同类型数据库,语法问题。 #212

Closed SkyBadBoy closed 4 years ago

SkyBadBoy commented 4 years ago

Enviroment

JDK Version(required): 1.8

SpringBoot Version(required): 2.0

dynamic-datasource-spring-boot-starter Version(required):3.3.1.temp

druid Version(optional):

Describe

finance: username: root password: 123456 driver-class-name: com.mysql.jdbc.Driver url: jdbc:mysql://192.168.199.105:3306/wg_finance?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true sqlservice: username: nf password: 123456 driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver url: jdbc:sqlserver://192.168.199.129:1433;DatabaseName=KTData

sqlservice居然使用了mysql 的语法,我明明用指定了sqlservice的

Expected Result:

SQL: INSERT INTO user ( id, username, password, age ) VALUES ( ?, ?, ?, ? )

Cause: com.microsoft.sqlserver.jdbc.SQLServerException: 关键字 'user' 附近有语法错误。

; uncategorized SQLException; SQL state [S0001]; error code [156]; 关键字 'user' 附近有语法错误。; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: 关键字 'user' 附近有语法错误。] with root cause

Actual Result:

Steps to reproduce

huayanYu commented 4 years ago

和本程序无关,本程序只负责切换数据源。