集成shardingsphere后出现异常 java.sql.SQLFeatureNotSupportedException: getCatalog
- Dominant language
- Java
- Stars
- 4.2k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
- [x] I have searched the [issues](https://github.com/codingapi/tx-lcn/issues) of this repository and believe that this is not a duplicate.
### 1.问题描述
在demo中集成 `shardingsphere 3.1.0` 后出现异常
```
java.sql.SQLFeatureNotSupportedException: getCatalog
```
**shardingsphere**
maven pom
```xml
io.shardingsphere
sharding-jdbc-spring-boot-starter
3.1.0
```
spring boot `application.yaml`
```yaml
sharding:
jdbc:
datasource:
names: ds0,ds1
ds0:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/txlcn-demo?useUnicode=true&characterEncoding=utf-8
username: root
password: 123456
filters: stat,wall,slf4j
ds1:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/txlcn-demo?useUnicode=true&characterEncoding=utf-8
username: root
password: 123456
filters: stat,wall,slf4j
config:
masterslave:
name: ms
load-balance-algorithm-type: round_robin
master-data-source-name: ds0
slave-data-source-names: ds1
props:
sql:
show: true
```
### 2. 环境:
- JDK version: 1.8.0_181
- OS: Windows 7
- TX-LCN version: 5.0.1.RELEASE
- Others: shardingsphere 3.1.0, spring-boot 1.5.9.RELEASE
### 3.异常信息
```
### Error updating database. Cause: java.lang.RuntimeException: java.sql.SQLFeatureNotSupportedException: getCatalog
### The error may involve com.codingapi.example.demod.DDemoMapper.save-Inline
### The error occurred while setting parameters
### SQL: insert into t_demo(kid, demo_field, group_id, unit_id, create_time,app_name) values(?, ?, ?, ?, ?,?)
### Cause: java.lang.RuntimeException: java.sql.SQLFeatureNotSupportedException: getCatalog] with root cause
java.sql.SQLFeatureNotSupportedException: getCatalog
at io.shardingsphere.shardingjdbc.jdbc.unsupported.AbstractUnsupportedOperationConnection.getCatalog(AbstractUnsupportedOperationConnection.java:91) ~[sharding-jdbc-core-3.1.0.jar:na]
at com.codingapi.txlcn.tc.core.transaction.txc.analy.TableStructAnalyser.analyse(TableStructAnalyser.java:51) ~[txlcn-tc-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at com.codingapi.txlcn.tc.core.transaction.txc.analy.TxcSqlExecuteInterceptor.lambda$postInsert$6(TxcSqlExecuteInterceptor.java:147) ~[txlcn-tc-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at com.codingapi.txlcn.tc.core.context.DefaultGlobalContext.tableStruct(DefaultGlobalContext.java:122) ~[txlcn-tc-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at com.codingapi.txlcn.tc.core.transaction.txc.analy.TxcSqlExecuteInterceptor.postInsert(TxcSqlExecuteInterceptor.java:146) ~[txlcn-tc-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at com.codingapi.txlcn.tc.core.transaction.txc.resource.TxcJdbcEventListener.onAfterExecute(TxcJdbcEventListener.java:81) ~[txlcn-tc-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at com.codingapi.txlcn.tc.core.transaction.txc.resource.CompoundJdbcEventListener.onAfterExecute(CompoundJdbcEventListener.java:93) ~[txlcn-tc-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at com.codingapi.txlcn.tc.support.p6spy.wrapper.PreparedStatementWrapper.execute(PreparedStatementWrapper.java:358) ~[txlcn-tc-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_171]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]
at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59) ~[mybatis-3.4.6.jar:3.4.6]
at com.sun.proxy.$Proxy144.execute(Unknown Source) ~[na:na]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:46) ~[mybatis-3.4.6.jar:3.4.6]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) ~[mybatis-3.4.6.jar:3.4.6]
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.