From 34a8cbb4cccb2ec19ed3ff1001a558a4f86ff95c Mon Sep 17 00:00:00 2001 From: zyyang Date: Sun, 17 Jan 2021 16:50:16 +0800 Subject: [PATCH] change --- .../java/com/taosdata/jdbc/StatementTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/StatementTest.java b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/StatementTest.java index c57231b44b..be849e2c97 100644 --- a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/StatementTest.java +++ b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/StatementTest.java @@ -35,6 +35,23 @@ public class StatementTest { statement.executeUpdate("drop database if exists " + dbName); } + @Test + public void testCase() { + try { + ResultSet rs = statement.executeQuery("show databases"); + ResultSetMetaData metaData = rs.getMetaData(); + while (rs.next()) { + for (int i = 1; i <= metaData.getColumnCount(); i++) { + System.out.print(metaData.getColumnLabel(i) + ":" + rs.getString(i) + "\t"); + } + System.out.println(); + } + } catch (SQLException e) { + e.printStackTrace(); + } + + } + @Test public void createTableAndQuery() throws SQLException { long ts = System.currentTimeMillis();