This is an automated email from the ASF dual-hosted git repository.
zykkk pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
new 8b854ab061 Revert "[improvement](jdbc-catalog) Add Connection
Keepalive and Detailed Error Messaging for Druid Pool in FE (#22502)" (#22631)
8b854ab061 is described below
commit 8b854ab06111d71b85d14830099edd27acffe3d6
Author: zy-kkk <[email protected]>
AuthorDate: Sat Aug 5 13:05:57 2023 +0800
Revert "[improvement](jdbc-catalog) Add Connection Keepalive and Detailed
Error Messaging for Druid Pool in FE (#22502)" (#22631)
This reverts commit f20664f709152f09c79919379292465d527b0650.
---
.../java/org/apache/doris/external/jdbc/JdbcClient.java | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcClient.java
b/fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcClient.java
index c8f9346155..51a18c67d6 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcClient.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/external/jdbc/JdbcClient.java
@@ -45,7 +45,6 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.Map;
-import java.util.Objects;
@Getter
public class JdbcClient {
@@ -110,9 +109,6 @@ public class JdbcClient {
// to FE to get schema info, and may create connection here, if we
set it too long and the url is invalid,
// it may cause the thrift rpc timeout.
dataSource.setMaxWait(5000);
- dataSource.setTestWhileIdle(true);
- dataSource.setTestOnBorrow(false);
- setValidationQuery(dataSource, dbType);
} catch (MalformedURLException e) {
throw new JdbcClientException("MalformedURLException to load class
about " + driverUrl, e);
} finally {
@@ -120,16 +116,6 @@ public class JdbcClient {
}
}
- private void setValidationQuery(DruidDataSource ds, String tableType) {
- if (Objects.equals(tableType, JdbcResource.ORACLE)) {
- ds.setValidationQuery("SELECT 1 FROM dual");
- } else if (Objects.equals(tableType, JdbcResource.SAP_HANA)) {
- ds.setValidationQuery("SELECT 1 FROM DUMMY");
- } else {
- ds.setValidationQuery("SELECT 1");
- }
- }
-
public void closeClient() {
dataSource.close();
}
@@ -139,7 +125,7 @@ public class JdbcClient {
try {
conn = dataSource.getConnection();
} catch (Exception e) {
- throw new JdbcClientException("Can not connect to jdbc due to
error: %s", e, e.getMessage());
+ throw new JdbcClientException("Can not connect to jdbc", e);
}
return conn;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]