ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: IGNITE-6139: JDBC thick driver: fixed driver versions. This closes #2552.
Date Mon, 04 Sep 2017 10:56:34 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 4b655a00c -> 9d35ea0e0


IGNITE-6139: JDBC thick driver: fixed driver versions. This closes #2552.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9d35ea0e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9d35ea0e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9d35ea0e

Branch: refs/heads/master
Commit: 9d35ea0e000059b7d63e7558534efa87055afab1
Parents: 4b655a0
Author: Ilya Kasnacheev <ilya.kasnacheev@gmail.com>
Authored: Mon Sep 4 13:56:25 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Mon Sep 4 13:56:25 2017 +0300

----------------------------------------------------------------------
 .../internal/jdbc2/JdbcMetadataSelfTest.java    | 19 +++++++++++
 .../internal/jdbc2/JdbcDatabaseMetadata.java    | 33 ++++++++++----------
 2 files changed, 36 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9d35ea0e/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcMetadataSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcMetadataSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcMetadataSelfTest.java
index bc4ef5b..a8611b9 100755
--- a/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcMetadataSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcMetadataSelfTest.java
@@ -41,6 +41,7 @@ import org.apache.ignite.cache.query.annotations.QuerySqlField;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.configuration.ConnectorConfiguration;
 import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteVersionUtils;
 import org.apache.ignite.internal.binary.BinaryMarshaller;
 import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
@@ -397,6 +398,24 @@ public class JdbcMetadataSelfTest extends GridCommonAbstractTest {
     }
 
     /**
+     * @throws Exception If failed.
+     */
+    public void testVersions() throws Exception {
+        try (Connection conn = DriverManager.getConnection(BASE_URL)) {
+            assertEquals("Apache Ignite", conn.getMetaData().getDatabaseProductName());
+            assertEquals("Ignite JDBC Driver", conn.getMetaData().getDriverName());
+            assertEquals(IgniteVersionUtils.VER.toString(), conn.getMetaData().getDatabaseProductVersion());
+            assertEquals(IgniteVersionUtils.VER.toString(), conn.getMetaData().getDriverVersion());
+            assertEquals(IgniteVersionUtils.VER.major(), conn.getMetaData().getDatabaseMajorVersion());
+            assertEquals(IgniteVersionUtils.VER.major(), conn.getMetaData().getDriverMajorVersion());
+            assertEquals(IgniteVersionUtils.VER.minor(), conn.getMetaData().getDatabaseMinorVersion());
+            assertEquals(IgniteVersionUtils.VER.minor(), conn.getMetaData().getDriverMinorVersion());
+            assertEquals(4, conn.getMetaData().getJDBCMajorVersion());
+            assertEquals(1, conn.getMetaData().getJDBCMinorVersion());
+        }
+    }
+
+    /**
      * Person.
      */
     @SuppressWarnings("UnusedDeclaration")

http://git-wip-us.apache.org/repos/asf/ignite/blob/9d35ea0e/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcDatabaseMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcDatabaseMetadata.java
b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcDatabaseMetadata.java
index ac8d9ce..1ccdbcd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcDatabaseMetadata.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcDatabaseMetadata.java
@@ -32,6 +32,7 @@ import java.util.Map;
 import java.util.UUID;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
+import org.apache.ignite.internal.IgniteVersionUtils;
 import org.apache.ignite.internal.processors.cache.IgniteCacheProxy;
 import org.apache.ignite.internal.processors.cache.query.GridCacheSqlIndexMetadata;
 import org.apache.ignite.internal.processors.cache.query.GridCacheSqlMetadata;
@@ -117,7 +118,17 @@ public class JdbcDatabaseMetadata implements DatabaseMetaData {
 
     /** {@inheritDoc} */
     @Override public String getDatabaseProductVersion() {
-        return "4.1.0";
+        return IgniteVersionUtils.VER.toString();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getDatabaseMajorVersion() {
+        return IgniteVersionUtils.VER.major();
+    }
+
+    /** {@inheritDoc} */
+    @Override public int getDatabaseMinorVersion() {
+        return IgniteVersionUtils.VER.minor();
     }
 
     /** {@inheritDoc} */
@@ -127,17 +138,17 @@ public class JdbcDatabaseMetadata implements DatabaseMetaData {
 
     /** {@inheritDoc} */
     @Override public String getDriverVersion() {
-        return "1.0";
+        return IgniteVersionUtils.VER.toString();
     }
 
     /** {@inheritDoc} */
     @Override public int getDriverMajorVersion() {
-        return 1;
+        return IgniteVersionUtils.VER.major();
     }
 
     /** {@inheritDoc} */
     @Override public int getDriverMinorVersion() {
-        return 0;
+        return IgniteVersionUtils.VER.minor();
     }
 
     /** {@inheritDoc} */
@@ -1174,23 +1185,13 @@ public class JdbcDatabaseMetadata implements DatabaseMetaData {
     }
 
     /** {@inheritDoc} */
-    @Override public int getDatabaseMajorVersion() {
-        return 1;
-    }
-
-    /** {@inheritDoc} */
-    @Override public int getDatabaseMinorVersion() {
-        return 0;
-    }
-
-    /** {@inheritDoc} */
     @Override public int getJDBCMajorVersion() {
-        return 1;
+        return 4;
     }
 
     /** {@inheritDoc} */
     @Override public int getJDBCMinorVersion() {
-        return 0;
+        return 1;
     }
 
     /** {@inheritDoc} */


Mime
View raw message