From ebf3b3a61e6439bd70535be27bb731457a9e3647 Mon Sep 17 00:00:00 2001 From: zyyang Date: Tue, 12 Jan 2021 11:31:51 +0800 Subject: [PATCH] change --- cmake/install.inc | 2 +- src/connector/jdbc/.classpath | 32 ------------------- src/connector/jdbc/.project | 23 ------------- src/connector/jdbc/CMakeLists.txt | 2 +- src/connector/jdbc/deploy-pom.xml | 2 +- src/connector/jdbc/pom.xml | 15 ++------- .../taosdata/jdbc/TSDBDatabaseMetaData.java | 16 +++++++--- 7 files changed, 16 insertions(+), 76 deletions(-) delete mode 100644 src/connector/jdbc/.classpath delete mode 100644 src/connector/jdbc/.project diff --git a/cmake/install.inc b/cmake/install.inc index 55b3fa188f..b0e5c71022 100755 --- a/cmake/install.inc +++ b/cmake/install.inc @@ -32,7 +32,7 @@ ELSEIF (TD_WINDOWS) #INSTALL(TARGETS taos RUNTIME DESTINATION driver) #INSTALL(TARGETS shell RUNTIME DESTINATION .) IF (TD_MVN_INSTALLED) - INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-2.0.15-dist.jar DESTINATION connector/jdbc) + INSTALL(FILES ${LIBRARY_OUTPUT_PATH}/taos-jdbcdriver-2.0.16-dist.jar DESTINATION connector/jdbc) ENDIF () ELSEIF (TD_DARWIN) SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh") diff --git a/src/connector/jdbc/.classpath b/src/connector/jdbc/.classpath deleted file mode 100644 index a5d95095cc..0000000000 --- a/src/connector/jdbc/.classpath +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/connector/jdbc/.project b/src/connector/jdbc/.project deleted file mode 100644 index 656ab58d20..0000000000 --- a/src/connector/jdbc/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - taos-jdbcdriver - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - - diff --git a/src/connector/jdbc/CMakeLists.txt b/src/connector/jdbc/CMakeLists.txt index e289f1ae1b..fda0289a2a 100644 --- a/src/connector/jdbc/CMakeLists.txt +++ b/src/connector/jdbc/CMakeLists.txt @@ -8,7 +8,7 @@ IF (TD_MVN_INSTALLED) ADD_CUSTOM_COMMAND(OUTPUT ${JDBC_CMD_NAME} POST_BUILD COMMAND mvn -Dmaven.test.skip=true install -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/target/taos-jdbcdriver-2.0.15-dist.jar ${LIBRARY_OUTPUT_PATH} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/target/taos-jdbcdriver-2.0.16-dist.jar ${LIBRARY_OUTPUT_PATH} COMMAND mvn -Dmaven.test.skip=true clean -f ${CMAKE_CURRENT_SOURCE_DIR}/pom.xml COMMENT "build jdbc driver") ADD_CUSTOM_TARGET(${JDBC_TARGET_NAME} ALL WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH} DEPENDS ${JDBC_CMD_NAME}) diff --git a/src/connector/jdbc/deploy-pom.xml b/src/connector/jdbc/deploy-pom.xml index 1a86bc57dc..5aa60c0df9 100755 --- a/src/connector/jdbc/deploy-pom.xml +++ b/src/connector/jdbc/deploy-pom.xml @@ -5,7 +5,7 @@ com.taosdata.jdbc taos-jdbcdriver - 2.0.15 + 2.0.16 jar JDBCDriver diff --git a/src/connector/jdbc/pom.xml b/src/connector/jdbc/pom.xml index 9865fc7127..d18d86258a 100755 --- a/src/connector/jdbc/pom.xml +++ b/src/connector/jdbc/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.taosdata.jdbc taos-jdbcdriver - 2.0.15 + 2.0.16 jar JDBCDriver https://github.com/taosdata/TDengine/tree/master/src/connector/jdbc @@ -49,6 +49,7 @@ + junit junit @@ -56,12 +57,6 @@ test - - mysql - mysql-connector-java - 5.1.47 - - org.apache.httpcomponents @@ -79,12 +74,6 @@ 1.2.58 - - mysql - mysql-connector-java - 5.1.49 - - 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 f4dee67adf..7b404c3844 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 @@ -35,12 +35,18 @@ public class TSDBDatabaseMetaData implements java.sql.DatabaseMetaData { this.conn = conn; } + + @Override public T unwrap(Class iface) throws SQLException { - return null; + try { + return iface.cast(this); + } catch (ClassCastException cce) { + throw new SQLException("Unable to unwrap to " + iface.toString()); + } } public boolean isWrapperFor(Class iface) throws SQLException { - return false; + return iface.isInstance(this); } public boolean allProceduresAreCallable() throws SQLException { @@ -80,11 +86,11 @@ public class TSDBDatabaseMetaData implements java.sql.DatabaseMetaData { } public String getDatabaseProductName() throws SQLException { - return this.dbProductName; + return "TDengine"; } public String getDatabaseProductVersion() throws SQLException { - return "1.5.1"; + return "2.0.x.x"; } public String getDriverName() throws SQLException { @@ -92,7 +98,7 @@ public class TSDBDatabaseMetaData implements java.sql.DatabaseMetaData { } public String getDriverVersion() throws SQLException { - return "1.0.0"; + return "2.0.x"; } public int getDriverMajorVersion() { -- GitLab