diff --git a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDatabaseMetaData.java b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDatabaseMetaData.java index 96ecd5a2bc77c735324b0debfe6eead94d1ebcd3..4ea0fc79507dc1c0f5a963fba0e055491561a6b4 100644 --- a/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDatabaseMetaData.java +++ b/src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBDatabaseMetaData.java @@ -900,7 +900,7 @@ public class TSDBDatabaseMetaData implements java.sql.DatabaseMetaData { } public int getDatabaseMajorVersion() throws SQLException { - return 0; + return 2; } public int getDatabaseMinorVersion() throws SQLException { @@ -908,7 +908,7 @@ public class TSDBDatabaseMetaData implements java.sql.DatabaseMetaData { } public int getJDBCMajorVersion() throws SQLException { - return 0; + return 2; } public int getJDBCMinorVersion() 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 42f8cff9cc133a13ac88f3abbcbf4a5984b0ab2a..448b513d0edadc0b8e3c3537acfdc83f25cb90b0 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 @@ -827,71 +827,87 @@ public class TSDBDatabaseMetaDataTest { } @Test - public void getResultSetHoldability() { - + public void getResultSetHoldability() throws SQLException { + Assert.assertEquals(1, metaData.getResultSetHoldability()); } @Test - public void getDatabaseMajorVersion() { + public void getDatabaseMajorVersion() throws SQLException { + Assert.assertEquals(2, metaData.getDatabaseMajorVersion()); } @Test - public void getDatabaseMinorVersion() { + public void getDatabaseMinorVersion() throws SQLException { + Assert.assertEquals(0, metaData.getDatabaseMinorVersion()); } @Test - public void getJDBCMajorVersion() { + public void getJDBCMajorVersion() throws SQLException { + Assert.assertEquals(2, metaData.getJDBCMajorVersion()); } @Test - public void getJDBCMinorVersion() { + public void getJDBCMinorVersion() throws SQLException { + Assert.assertEquals(0, metaData.getJDBCMinorVersion()); } @Test - public void getSQLStateType() { + public void getSQLStateType() throws SQLException { + Assert.assertEquals(0, metaData.getSQLStateType()); } @Test - public void locatorsUpdateCopy() { + public void locatorsUpdateCopy() throws SQLException { + Assert.assertFalse(metaData.locatorsUpdateCopy()); } @Test - public void supportsStatementPooling() { + public void supportsStatementPooling() throws SQLException { + Assert.assertFalse(metaData.supportsStatementPooling()); } @Test - public void getRowIdLifetime() { + public void getRowIdLifetime() throws SQLException { + Assert.assertNull(metaData.getRowIdLifetime()); } @Test - public void testGetSchemas() { + public void testGetSchemas() throws SQLException { + Assert.assertNull(metaData.getSchemas()); } @Test - public void supportsStoredFunctionsUsingCallSyntax() { + public void supportsStoredFunctionsUsingCallSyntax() throws SQLException { + Assert.assertFalse(metaData.supportsStoredFunctionsUsingCallSyntax()); } @Test - public void autoCommitFailureClosesAllResultSets() { + public void autoCommitFailureClosesAllResultSets() throws SQLException { + Assert.assertFalse(metaData.autoCommitFailureClosesAllResultSets()); } @Test - public void getClientInfoProperties() { + public void getClientInfoProperties() throws SQLException { + Assert.assertNotNull(metaData.getClientInfoProperties()); } @Test - public void getFunctions() { + public void getFunctions() throws SQLException { + Assert.assertNotNull(metaData.getFunctions("", "", "")); } @Test - public void getFunctionColumns() { + public void getFunctionColumns() throws SQLException { + Assert.assertNotNull(metaData.getFunctionColumns("", "", "", "")); } @Test - public void getPseudoColumns() { + public void getPseudoColumns() throws SQLException { + Assert.assertNotNull(metaData.getPseudoColumns("", "", "", "")); } @Test - public void generatedKeyAlwaysReturned() { + public void generatedKeyAlwaysReturned() throws SQLException { + Assert.assertFalse(metaData.generatedKeyAlwaysReturned()); } } \ No newline at end of file