Skip to content

Commit

Permalink
mysql-connector-version upgrade: 5.1.40 -> 8.0.22
Browse files Browse the repository at this point in the history
  • Loading branch information
ShengyuanLu committed Jan 11, 2021
1 parent bc48591 commit ab33689
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions das-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.ppdai.das</groupId>
<artifactId>das-client</artifactId>
<version>2.6.1-SNAPSHOT</version>
<version>2.7.0-SNAPSHOT</version>
<properties>
<ver.version>${project.version}</ver.version>
<junit-version>4.13</junit-version>
<javax-persistence-version>1.0.2</javax-persistence-version>
<sqljdbc-version>6.2.2.jre7.ctrip</sqljdbc-version>
<mysql-connector-version>5.1.44</mysql-connector-version>
<mysql-connector-version>8.0.22</mysql-connector-version>
<oracle-jdbc-thin-version>11.2.0.4</oracle-jdbc-thin-version>
<tomcat-jdbc-version>8.5.11</tomcat-jdbc-version>
<javax.servlet-api-version>3.1-b09</javax.servlet-api-version>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ppdai.das.core.datasource;

import com.mysql.jdbc.MySQLConnection;
import com.mysql.cj.jdbc.ConnectionImpl;
import com.ppdai.das.core.helper.MySqlConnectionHelper;

import org.apache.tomcat.jdbc.pool.PoolProperties;
Expand Down Expand Up @@ -36,8 +36,8 @@ public boolean validate(Connection connection, int validateAction) {
}

if (query == null) {
if (connection instanceof MySQLConnection) {
MySQLConnection mySqlConnection = (MySQLConnection) connection;
if (connection instanceof ConnectionImpl) {
ConnectionImpl mySqlConnection = (ConnectionImpl) connection;
isValid = MySqlConnectionHelper.isValid(mySqlConnection, DEFAULT_VALIDATE_TIMEOUT_IN_SECONDS);
} else {
isValid = connection.isValid(DEFAULT_VALIDATE_TIMEOUT_IN_SECONDS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import com.microsoft.sqlserver.jdbc.SQLServerCallableStatement;
import com.microsoft.sqlserver.jdbc.SQLServerDataTable;
import com.mysql.jdbc.exceptions.MySQLTimeoutException;
import com.mysql.cj.jdbc.exceptions.MySQLTimeoutException;
import com.ppdai.das.client.Parameter;
import com.ppdai.das.core.markdown.ErrorContext;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.ppdai.das.core.helper;

import com.mysql.jdbc.MySQLConnection;
import com.mysql.cj.jdbc.ConnectionImpl;

public class MySqlConnectionHelper {

public static boolean isValid(MySQLConnection connection, int timeout) {
public static boolean isValid(ConnectionImpl connection, int timeout) {
return pingInternal(connection, timeout);
}

private static boolean pingInternal(MySQLConnection connection, int timeout) {
private static boolean pingInternal(ConnectionImpl connection, int timeout) {
if (connection == null) {
return false;
}
Expand Down

0 comments on commit ab33689

Please sign in to comment.