You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "xuschang (via GitHub)" <gi...@apache.org> on 2023/08/04 11:18:11 UTC
[GitHub] [shardingsphere] xuschang opened a new issue, #27921: ShardingSphere-jdbc5.4.0 driverClassName: org.mariadb.jdbc.Driver does not take effect.
xuschang opened a new issue, #27921:
URL: https://github.com/apache/shardingsphere/issues/27921
## Bug Report
driverClassName: org.mariadb.jdbc.Driver does not take effect.
### Which version of ShardingSphere did you use?
ShardingSphere-jdbc 5.4.0
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-jdbc 5.4.0
### Expected behavior
Can load the correct driverClass configuration
### Actual behavior
loaded the com.mysql.jdbc.Driver driver, but it is excluded in my project.
### Reason analyze (If you can)
The ``SKIPPED_PROPERTY_KEYS`` in the ``DataSourceReflection`` class includes "``driverClassName``", so the property cannot be injected. If the driverClass in the data source is empty, the default driver will be loaded via the URL. For jdbc:mysql:/xxxx:3306/db?xxx, the corresponding driver is com.mysql.jdbc.driver, but this is not the one I configured, which is org.mariadb.jdbc.Driver. If I remove the "driverClassName" exclusion, the program works normally.
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
config.yaml
```
dataSources:
db-0:
dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
driverClassName: org.mariadb.jdbc.Driver
url: jdbc:mysql://xxxx:3306/uihpacsdb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2B8&allowMultiQueries=true
username: root
password: 123456
```
pom.xml
```
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<scope>runtime</scope>
</dependency>
```
Ensure that the project does not have the JDBC driver com.mysql.jdbc.Driver.
the result is:
```
2023-08-04 18:59:06.575 ERROR [http-nio-8080-exec-1] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} init error
java.sql.SQLException: com.mysql.jdbc.Driver
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:676)
at com.alibaba.druid.pool.DruidDataSource.resolveDriver(DruidDataSource.java:1203)
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:878)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ShardingSphere-jdbc5.4.0 driverClassName: org.mariadb.jdbc.Driver does not take effect. [shardingsphere]
Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #27921:
URL: https://github.com/apache/shardingsphere/issues/27921#issuecomment-2160497421
- I simply created #31653 to locate this issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ShardingSphere-jdbc5.4.0 driverClassName: org.mariadb.jdbc.Driver does not take effect. [shardingsphere]
Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian closed issue #27921: ShardingSphere-jdbc5.4.0 driverClassName: org.mariadb.jdbc.Driver does not take effect.
URL: https://github.com/apache/shardingsphere/issues/27921
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] xuschang commented on issue #27921: ShardingSphere-jdbc5.4.0 driverClassName: org.mariadb.jdbc.Driver does not take effect.
Posted by "xuschang (via GitHub)" <gi...@apache.org>.
xuschang commented on issue #27921:
URL: https://github.com/apache/shardingsphere/issues/27921#issuecomment-1665784122
> > If I remove the "driverClassName" exclusion in SKIPPED_PROPERTY_KEYS, the program works normally.
>
> Hi @xuschang Thanks for you feedback, do you want to fix it?
I am willing to fix it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] github-actions[bot] commented on issue #27921: ShardingSphere-jdbc5.4.0 driverClassName: org.mariadb.jdbc.Driver does not take effect.
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #27921:
URL: https://github.com/apache/shardingsphere/issues/27921#issuecomment-1704390033
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on issue #27921: ShardingSphere-jdbc5.4.0 driverClassName: org.mariadb.jdbc.Driver does not take effect.
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #27921:
URL: https://github.com/apache/shardingsphere/issues/27921#issuecomment-1665738645
Found a related PR #15409
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on issue #27921: ShardingSphere-jdbc5.4.0 driverClassName: org.mariadb.jdbc.Driver does not take effect.
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #27921:
URL: https://github.com/apache/shardingsphere/issues/27921#issuecomment-1665753112
> If I remove the "driverClassName" exclusion in SKIPPED_PROPERTY_KEYS, the program works normally.
Hi @xuschang
Thanks for you feedback, do you want to fix it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org