You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/08/25 07:49:06 UTC
[GitHub] [shardingsphere] sandynz commented on a diff in pull request #20507: Adapt MySQL Connector/J version 5 and 8 of zeroDateTimeBehavior jdbcUrl param
sandynz commented on code in PR #20507:
URL: https://github.com/apache/shardingsphere/pull/20507#discussion_r954618316
##########
shardingsphere-kernel/shardingsphere-data-pipeline/shardingsphere-data-pipeline-dialect/shardingsphere-data-pipeline-mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/datasource/MySQLJdbcQueryPropertiesExtension.java:
##########
@@ -17,22 +17,39 @@
package org.apache.shardingsphere.data.pipeline.mysql.datasource;
+import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.data.pipeline.spi.datasource.JdbcQueryPropertiesExtension;
import java.util.Properties;
/**
* MySQL JDBC query properties extension.
*/
+@Slf4j
public final class MySQLJdbcQueryPropertiesExtension implements JdbcQueryPropertiesExtension {
+ private static Class<?> mysqlDriverClass;
+
+ static {
+ try {
+ mysqlDriverClass = MySQLJdbcQueryPropertiesExtension.class.getClassLoader().loadClass("com.mysql.jdbc.Driver");
+ } catch (ClassNotFoundException e) {
+ log.warn("not find com.mysql.jdbc.Driver class");
+ }
+ }
Review Comment:
1, Could we just output MySQL version here? And we could set different `zeroDateTimeBehavior` value based on MySQL version.
2, `ClassNotFoundException e` could be `final ClassNotFoundException ex`
--
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