From f968071b1bd15626c1be866c4b3098e6d2bac144 Mon Sep 17 00:00:00 2001 From: xieyinglin Date: Thu, 24 Oct 2019 16:18:11 +0800 Subject: [PATCH] add druid pool support for issue #642 --- .../java/com/taosdata/jdbc/TSDBConnection.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBConnection.java b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBConnection.java index de86162b1c..4640f6b446 100644 --- a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBConnection.java +++ b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBConnection.java @@ -170,8 +170,13 @@ public class TSDBConnection implements Connection { public void setTransactionIsolation(int level) throws SQLException { } + /** + * The transaction isolation level option is not supported by TDengine. + * @return + * @throws SQLException + */ public int getTransactionIsolation() throws SQLException { - throw new SQLException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG); + return Connection.TRANSACTION_NONE; } public SQLWarning getWarnings() throws SQLException { @@ -214,11 +219,17 @@ public class TSDBConnection implements Connection { } public void setHoldability(int holdability) throws SQLException { - throw new SQLException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG); + // intentionally left empty to support druid connection pool. } + /** + * the transaction is not supported by TDengine, so the opened ResultSet Objects will remain open + * @return + * @throws SQLException + */ public int getHoldability() throws SQLException { - throw new SQLException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG); + //intentionally left empty to support HikariCP connection. + return ResultSet.HOLD_CURSORS_OVER_COMMIT; } public Savepoint setSavepoint() throws SQLException { -- GitLab