From 1e1e947310677984fdc42cab5e9aa4a1881d4b98 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 19 Nov 2020 15:12:18 +0800 Subject: [PATCH] [TD-225] --- .../java/com/taosdata/jdbc/TSDBDriver.java | 2 +- .../taosdata/jdbc/TSDBResultSetBlockData.java | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDriver.java b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDriver.java index 4dc48c84b3..06f88cebfa 100755 --- a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDriver.java +++ b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDriver.java @@ -89,7 +89,7 @@ public class TSDBDriver extends AbstractTaosDriver { /** * fetch data from native function in a batch model */ - public static final String PROPERTY_KEY_BATCH_LOAD = "batch"; + public static final String PROPERTY_KEY_BATCH_LOAD = "batchfetch"; private TSDBDatabaseMetaData dbMetaData = null; diff --git a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBResultSetBlockData.java b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBResultSetBlockData.java index 7373890428..9352cf5253 100644 --- a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBResultSetBlockData.java +++ b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBResultSetBlockData.java @@ -31,8 +31,6 @@ import java.util.List; public class TSDBResultSetBlockData { private int numOfRows = 0; - private int numOfCols = 0; - private int rowIndex = 0; private List columnMetaDataList; @@ -40,22 +38,20 @@ public class TSDBResultSetBlockData { public TSDBResultSetBlockData(List colMeta, int numOfCols) { this.columnMetaDataList = colMeta; - this.setNumOfCols(numOfCols); + this.colData = new ArrayList(numOfCols); } public TSDBResultSetBlockData() { this.colData = new ArrayList(); - this.setNumOfCols(0); } public void clear() { + int size = this.colData.size(); if (this.colData != null) { this.colData.clear(); } - - if (this.numOfCols == 0) { - return; - } + + setNumOfCols(size); } public int getNumOfRows() { @@ -67,12 +63,12 @@ public class TSDBResultSetBlockData { } public int getNumOfCols() { - return numOfCols; + return this.colData.size(); } public void setNumOfCols(int numOfCols) { - this.numOfCols = numOfCols; - this.clear(); + this.colData = new ArrayList(numOfCols); + this.colData.addAll(Collections.nCopies(numOfCols, null)); } public boolean hasMore() { -- GitLab