提交 7beef60c 编写于 作者: Z zyyang-taosdata

[TD-1313]<hotfix>: implement getColumns method in the TSDBDatabaseMetadata and...

[TD-1313]<hotfix>: implement getColumns method in the TSDBDatabaseMetadata and update the next method in DatabaseMetaDataResultSet
上级 d08432ea
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
<version>4.13</version> <version>4.13</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
......
...@@ -67,14 +67,23 @@ public class DatabaseMetaDataResultSet implements ResultSet { ...@@ -67,14 +67,23 @@ public class DatabaseMetaDataResultSet implements ResultSet {
@Override @Override
public boolean next() throws SQLException { public boolean next() throws SQLException {
// boolean ret = false;
// if (rowDataList.size() > 0) {
// ret = rowDataList.iterator().hasNext();
// if (ret) {
// rowCursor = rowDataList.iterator().next();
// cursorRowNumber++;
// }
// }
// return ret;
/**** add by zyyang 2020-09-29 ****************/
boolean ret = false; boolean ret = false;
if (rowDataList.size() > 0) { if (!rowDataList.isEmpty() && cursorRowNumber < rowDataList.size()) {
ret = rowDataList.iterator().hasNext(); rowCursor = rowDataList.get(cursorRowNumber++);
if (ret) { ret = true;
rowCursor = rowDataList.iterator().next();
cursorRowNumber++;
}
} }
return ret; return ret;
} }
...@@ -91,7 +100,8 @@ public class DatabaseMetaDataResultSet implements ResultSet { ...@@ -91,7 +100,8 @@ public class DatabaseMetaDataResultSet implements ResultSet {
@Override @Override
public String getString(int columnIndex) throws SQLException { public String getString(int columnIndex) throws SQLException {
columnIndex--; columnIndex--;
return rowCursor.getString(columnIndex, columnMetaDataList.get(columnIndex).getColType()); int colType = columnMetaDataList.get(columnIndex).getColType();
return rowCursor.getString(columnIndex, colType);
} }
@Override @Override
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册