From 851a0b64ac9f5a6e2c7cffca68a08d292a8655de Mon Sep 17 00:00:00 2001 From: zyyang Date: Thu, 21 Jan 2021 14:19:20 +0800 Subject: [PATCH] change getSchemas method --- .../java/com/taosdata/jdbc/AbstractDatabaseMetaData.java | 7 +++---- .../java/com/taosdata/jdbc/TSDBDatabaseMetaDataTest.java | 5 ----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/AbstractDatabaseMetaData.java b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/AbstractDatabaseMetaData.java index 917f2aead9..ac5f0a747e 100644 --- a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/AbstractDatabaseMetaData.java +++ b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/AbstractDatabaseMetaData.java @@ -493,11 +493,10 @@ public abstract class AbstractDatabaseMetaData implements DatabaseMetaData, Wrap return null; } - public abstract ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) - throws SQLException; + public abstract ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException; public ResultSet getSchemas() throws SQLException { - return null; + return getEmptyResultSet(); } public abstract ResultSet getCatalogs() throws SQLException; @@ -753,7 +752,7 @@ public abstract class AbstractDatabaseMetaData implements DatabaseMetaData, Wrap } public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException { - return null; + return getEmptyResultSet(); } public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException { diff --git a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/TSDBDatabaseMetaDataTest.java b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/TSDBDatabaseMetaDataTest.java index 77223b40fa..94e21a721c 100644 --- a/src/connector/jdbc/src/test/java/com/taosdata/jdbc/TSDBDatabaseMetaDataTest.java +++ b/src/connector/jdbc/src/test/java/com/taosdata/jdbc/TSDBDatabaseMetaDataTest.java @@ -914,11 +914,6 @@ public class TSDBDatabaseMetaDataTest { Assert.assertNull(metaData.getRowIdLifetime()); } - @Test - public void testGetSchemas() throws SQLException { - Assert.assertNull(metaData.getSchemas()); - } - @Test public void supportsStoredFunctionsUsingCallSyntax() throws SQLException { Assert.assertFalse(metaData.supportsStoredFunctionsUsingCallSyntax()); -- GitLab