ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [11/29] ignite git commit: IGNITE-6556: JDBC thin: fixed setSchema() case sensitivity handling. This closes #2805.
Date Mon, 09 Oct 2017 14:51:18 GMT
IGNITE-6556: JDBC thin: fixed setSchema() case sensitivity handling. This closes #2805.


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

Branch: refs/heads/ignite-5937
Commit: 3c355e9f6e8c4c38bb14ac3d3c6ccfee378af1ab
Parents: df3c407
Author: tledkov-gridgain <tledkov@gridgain.com>
Authored: Thu Oct 5 16:45:31 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Thu Oct 5 16:45:31 2017 +0300

----------------------------------------------------------------------
 .../JdbcThinAbstractDmlStatementSelfTest.java   |  2 +-
 .../thin/JdbcThinAutoCloseServerCursorTest.java |  8 ++--
 .../jdbc/thin/JdbcThinComplexQuerySelfTest.java |  2 +-
 .../jdbc/thin/JdbcThinConnectionSelfTest.java   |  4 ++
 .../JdbcThinDynamicIndexAbstractSelfTest.java   |  2 +-
 .../jdbc/thin/JdbcThinEmptyCacheSelfTest.java   |  2 +-
 .../jdbc/thin/JdbcThinMetadataSelfTest.java     |  4 +-
 .../JdbcThinMissingLongArrayResultsTest.java    |  2 +-
 .../jdbc/thin/JdbcThinNoDefaultSchemaTest.java  |  5 ++-
 .../thin/JdbcThinPreparedStatementSelfTest.java |  2 +-
 .../jdbc/thin/JdbcThinResultSetSelfTest.java    |  2 +-
 .../jdbc/thin/JdbcThinStatementSelfTest.java    | 46 +++++++++++---------
 .../internal/jdbc/thin/JdbcThinConnection.java  |  6 +--
 .../jdbc/thin/JdbcThinPreparedStatement.java    |  5 ++-
 .../internal/jdbc/thin/JdbcThinStatement.java   |  9 +++-
 15 files changed, 59 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3c355e9f/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinAbstractDmlStatementSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinAbstractDmlStatementSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinAbstractDmlStatementSelfTest.java
index 607f557..afe5e2e 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinAbstractDmlStatementSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinAbstractDmlStatementSelfTest.java
@@ -69,7 +69,7 @@ public abstract class JdbcThinAbstractDmlStatementSelfTest extends JdbcThinAbstr
 
         conn = DriverManager.getConnection(URL);
 
-        conn.setSchema(DEFAULT_CACHE_NAME);
+        conn.setSchema('"' + DEFAULT_CACHE_NAME + '"');
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/3c355e9f/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinAutoCloseServerCursorTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinAutoCloseServerCursorTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinAutoCloseServerCursorTest.java
index eff504b..db4ed3f 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinAutoCloseServerCursorTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinAutoCloseServerCursorTest.java
@@ -115,7 +115,7 @@ public class JdbcThinAutoCloseServerCursorTest extends JdbcThinAbstractSelfTest
             cache.put(person.id, person);
 
         try (Connection conn = DriverManager.getConnection(URL)) {
-            conn.setSchema(CACHE_NAME);
+            conn.setSchema('"' + CACHE_NAME + '"');
 
             String sqlText = "select * from Person";
 
@@ -198,7 +198,7 @@ public class JdbcThinAutoCloseServerCursorTest extends JdbcThinAbstractSelfTest
      */
     public void testInsert() throws Exception {
         try (Connection conn = DriverManager.getConnection(URL)) {
-            conn.setSchema(CACHE_NAME);
+            conn.setSchema('"' + CACHE_NAME + '"');
 
             String sqlText = "insert into Person (_key, id, name, age) values (?, ?, ?, ?)";
 
@@ -233,7 +233,7 @@ public class JdbcThinAutoCloseServerCursorTest extends JdbcThinAbstractSelfTest
         cache.put(1, p);
 
         try (Connection conn = DriverManager.getConnection(URL)) {
-            conn.setSchema(CACHE_NAME);
+            conn.setSchema('"' + CACHE_NAME + '"');
 
             String sqlText = "update Person set age = age + 1";
 
@@ -258,7 +258,7 @@ public class JdbcThinAutoCloseServerCursorTest extends JdbcThinAbstractSelfTest
         cache.put(1, p);
 
         try (Connection conn = DriverManager.getConnection(URL)) {
-            conn.setSchema(CACHE_NAME);
+            conn.setSchema('"' + CACHE_NAME + '"');
 
             String sqlText = "delete Person where age = ?";
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3c355e9f/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexQuerySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexQuerySelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexQuerySelfTest.java
index 1714ab1..ad1e312 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexQuerySelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexQuerySelfTest.java
@@ -113,7 +113,7 @@ public class JdbcThinComplexQuerySelfTest extends JdbcThinAbstractSelfTest
{
     @Override protected void beforeTest() throws Exception {
         Connection conn = DriverManager.getConnection(URL);
 
-        conn.setSchema("pers");
+        conn.setSchema("\"pers\"");
 
         stmt = conn.createStatement();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3c355e9f/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
index 17ce686..fbbec0d 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinConnectionSelfTest.java
@@ -1633,6 +1633,10 @@ public class JdbcThinConnectionSelfTest extends JdbcThinAbstractSelfTest
{
 
             conn.setSchema(schema);
 
+            assertEquals(schema.toUpperCase(), conn.getSchema());
+
+            conn.setSchema('"' + schema + '"');
+
             assertEquals(schema, conn.getSchema());
 
             conn.close();

http://git-wip-us.apache.org/repos/asf/ignite/blob/3c355e9f/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDynamicIndexAbstractSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDynamicIndexAbstractSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDynamicIndexAbstractSelfTest.java
index 5089894..dbe93a4 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDynamicIndexAbstractSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDynamicIndexAbstractSelfTest.java
@@ -309,7 +309,7 @@ public abstract class JdbcThinDynamicIndexAbstractSelfTest extends JdbcThinAbstr
         assertEquals(expSize, cache().size());
 
         try (Statement stmt = conn.createStatement()) {
-            conn.setSchema(DEFAULT_CACHE_NAME);
+            conn.setSchema('"' + DEFAULT_CACHE_NAME + '"');
 
             try (ResultSet rs = stmt.executeQuery("SELECT COUNT(*) from Person")) {
                 assertEquals(expSize, getSingleValue(rs));

http://git-wip-us.apache.org/repos/asf/ignite/blob/3c355e9f/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinEmptyCacheSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinEmptyCacheSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinEmptyCacheSelfTest.java
index 1ede536..41b4338 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinEmptyCacheSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinEmptyCacheSelfTest.java
@@ -87,7 +87,7 @@ public class JdbcThinEmptyCacheSelfTest extends JdbcThinAbstractSelfTest
{
     @Override protected void beforeTest() throws Exception {
         Connection conn = DriverManager.getConnection(URL);
 
-        conn.setSchema(CACHE_NAME);
+        conn.setSchema('"' + CACHE_NAME + '"');
 
         stmt = conn.createStatement();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3c355e9f/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
index abbe4e1..6c20de0 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
@@ -156,7 +156,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest
{
     public void testResultSetMetaData() throws Exception {
         Connection conn = DriverManager.getConnection(URL);
 
-        conn.setSchema("pers");
+        conn.setSchema("\"pers\"");
 
         Statement stmt = conn.createStatement();
 
@@ -528,7 +528,7 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest
{
      */
     public void testParametersMetadata() throws Exception {
         try (Connection conn = DriverManager.getConnection(URL)) {
-            conn.setSchema("pers");
+            conn.setSchema("\"pers\"");
 
             PreparedStatement stmt = conn.prepareStatement("select orgId from Person p where
p.name > ? and p.orgId > ?");
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3c355e9f/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMissingLongArrayResultsTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMissingLongArrayResultsTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMissingLongArrayResultsTest.java
index 1a53ab7..1f6e2c0 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMissingLongArrayResultsTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMissingLongArrayResultsTest.java
@@ -171,7 +171,7 @@ public class JdbcThinMissingLongArrayResultsTest extends JdbcThinAbstractSelfTes
     @SuppressWarnings({"EmptyTryBlock", "unused"})
     public void testDefaults() throws Exception {
         try (Connection conn = DriverManager.getConnection(URL)) {
-            conn.setSchema(CACHE_NAME);
+            conn.setSchema('"' + CACHE_NAME + '"');
 
             try (PreparedStatement st = conn.prepareStatement("SELECT * FROM VALUE")) {
                 ResultSet rs = st.executeQuery();

http://git-wip-us.apache.org/repos/asf/ignite/blob/3c355e9f/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinNoDefaultSchemaTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinNoDefaultSchemaTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinNoDefaultSchemaTest.java
index cab28f4..a1be582 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinNoDefaultSchemaTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinNoDefaultSchemaTest.java
@@ -219,10 +219,13 @@ public class JdbcThinNoDefaultSchemaTest extends JdbcThinAbstractSelfTest
{
                 }
             }, SQLException.class, "Failed to parse query");
 
-            conn.setSchema("cache1");
+            conn.setSchema("\"cache1\"");
 
             Statement stmt = conn.createStatement();
 
+            //Must not affects previous created statements.
+            conn.setSchema("invalid_schema");
+
             stmt.execute("select t._key, t._val from Integer t");
 
             ResultSet rs = stmt.getResultSet();

http://git-wip-us.apache.org/repos/asf/ignite/blob/3c355e9f/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPreparedStatementSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPreparedStatementSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPreparedStatementSelfTest.java
index 85eb1d3..c577853 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPreparedStatementSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPreparedStatementSelfTest.java
@@ -148,7 +148,7 @@ public class JdbcThinPreparedStatementSelfTest extends JdbcThinAbstractSelfTest
     @Override protected void beforeTest() throws Exception {
         conn = DriverManager.getConnection(URL);
 
-        conn.setSchema(DEFAULT_CACHE_NAME);
+        conn.setSchema('"' + DEFAULT_CACHE_NAME + '"');
 
         assert conn != null;
         assert !conn.isClosed();

http://git-wip-us.apache.org/repos/asf/ignite/blob/3c355e9f/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinResultSetSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinResultSetSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinResultSetSelfTest.java
index 5a3c5df..fd46cda 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinResultSetSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinResultSetSelfTest.java
@@ -120,7 +120,7 @@ public class JdbcThinResultSetSelfTest extends JdbcThinAbstractSelfTest
{
     @Override protected void beforeTest() throws Exception {
         Connection conn = DriverManager.getConnection(URL);
 
-        conn.setSchema(DEFAULT_CACHE_NAME);
+        conn.setSchema('"' + DEFAULT_CACHE_NAME + '"');
 
         stmt = conn.createStatement();
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/3c355e9f/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinStatementSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinStatementSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinStatementSelfTest.java
index 5309465..82c0512 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinStatementSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinStatementSelfTest.java
@@ -104,7 +104,7 @@ public class JdbcThinStatementSelfTest extends JdbcThinAbstractSelfTest
{
     @Override protected void beforeTest() throws Exception {
         conn = DriverManager.getConnection(URL);
 
-        conn.setSchema(DEFAULT_CACHE_NAME);
+        conn.setSchema('"' + DEFAULT_CACHE_NAME + '"');
 
         stmt = conn.createStatement();
 
@@ -444,6 +444,8 @@ public class JdbcThinStatementSelfTest extends JdbcThinAbstractSelfTest
{
     public void testExecuteQueryMultipleOnlyDml() throws Exception {
         conn.setSchema(null);
 
+        Statement stmt0 = conn.createStatement();
+
         int stmtCnt = 10;
 
         StringBuilder sql = new StringBuilder("drop table if exists test; create table test(ID
int primary key, NAME varchar(20)); ");
@@ -451,24 +453,24 @@ public class JdbcThinStatementSelfTest extends JdbcThinAbstractSelfTest
{
         for (int i = 0; i < stmtCnt; ++i)
             sql.append("insert into test (ID, NAME) values (" + i + ", 'name_" + i +"');
");
 
-        assert !stmt.execute(sql.toString());
+        assert !stmt0.execute(sql.toString());
 
         // DROP TABLE statement
-        assert stmt.getResultSet() == null;
-        assert stmt.getUpdateCount() == 0;
+        assert stmt0.getResultSet() == null;
+        assert stmt0.getUpdateCount() == 0;
 
         // CREATE TABLE statement
-        assert stmt.getResultSet() == null;
-        assert stmt.getUpdateCount() == 0;
+        assert stmt0.getResultSet() == null;
+        assert stmt0.getUpdateCount() == 0;
 
         for (int i = 0; i < stmtCnt; ++i) {
-            assert stmt.getMoreResults();
+            assert stmt0.getMoreResults();
 
-            assert stmt.getResultSet() == null;
-            assert stmt.getUpdateCount() == 1;
+            assert stmt0.getResultSet() == null;
+            assert stmt0.getUpdateCount() == 1;
         }
 
-        assert !stmt.getMoreResults();
+        assert !stmt0.getMoreResults();
     }
 
     /**
@@ -477,6 +479,8 @@ public class JdbcThinStatementSelfTest extends JdbcThinAbstractSelfTest
{
     public void testExecuteQueryMultipleMixed() throws Exception {
         conn.setSchema(null);
 
+        Statement stmt0 = conn.createStatement();
+
         int stmtCnt = 10;
 
         StringBuilder sql = new StringBuilder("drop table if exists test; create table test(ID
int primary key, NAME varchar(20)); ");
@@ -488,29 +492,29 @@ public class JdbcThinStatementSelfTest extends JdbcThinAbstractSelfTest
{
                 sql.append(" select * from test where id < " + i + "; ");
         }
 
-        assert !stmt.execute(sql.toString());
+        assert !stmt0.execute(sql.toString());
 
         // DROP TABLE statement
-        assert stmt.getResultSet() == null;
-        assert stmt.getUpdateCount() == 0;
+        assert stmt0.getResultSet() == null;
+        assert stmt0.getUpdateCount() == 0;
 
         // CREATE TABLE statement
-        assert stmt.getResultSet() == null;
-        assert stmt.getUpdateCount() == 0;
+        assert stmt0.getResultSet() == null;
+        assert stmt0.getUpdateCount() == 0;
 
         boolean notEmptyResult = false;
 
         for (int i = 0; i < stmtCnt; ++i) {
-            assert stmt.getMoreResults();
+            assert stmt0.getMoreResults();
 
             if (i % 2 == 0) {
-                assert stmt.getResultSet() == null;
-                assert stmt.getUpdateCount() == 1;
+                assert stmt0.getResultSet() == null;
+                assert stmt0.getUpdateCount() == 1;
             }
             else {
-                assert stmt.getUpdateCount() == -1;
+                assert stmt0.getUpdateCount() == -1;
 
-                ResultSet rs = stmt.getResultSet();
+                ResultSet rs = stmt0.getResultSet();
 
                 int rowsCnt = 0;
 
@@ -526,7 +530,7 @@ public class JdbcThinStatementSelfTest extends JdbcThinAbstractSelfTest
{
 
         assert notEmptyResult;
 
-        assert !stmt.getMoreResults();
+        assert !stmt0.getMoreResults();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/3c355e9f/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java
b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java
index d804750..5afed4e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java
@@ -168,7 +168,7 @@ public class JdbcThinConnection implements Connection {
 
         checkCursorOptions(resSetType, resSetConcurrency, resSetHoldability);
 
-        JdbcThinStatement stmt  = new JdbcThinStatement(this, resSetHoldability);
+        JdbcThinStatement stmt  = new JdbcThinStatement(this, resSetHoldability, schema);
 
         if (timeout > 0)
             stmt.timeout(timeout);
@@ -197,7 +197,7 @@ public class JdbcThinConnection implements Connection {
         if (sql == null)
             throw new SQLException("SQL string cannot be null.");
 
-        JdbcThinPreparedStatement stmt = new JdbcThinPreparedStatement(this, sql, resSetHoldability);
+        JdbcThinPreparedStatement stmt = new JdbcThinPreparedStatement(this, sql, resSetHoldability,
schema);
 
         if (timeout > 0)
             stmt.timeout(timeout);
@@ -592,7 +592,7 @@ public class JdbcThinConnection implements Connection {
     @Override public void setSchema(String schema) throws SQLException {
         ensureNotClosed();
 
-        this.schema = schema;
+        this.schema = normalizeSchema(schema);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/3c355e9f/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinPreparedStatement.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinPreparedStatement.java
b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinPreparedStatement.java
index fb2810d..23d3bbe 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinPreparedStatement.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinPreparedStatement.java
@@ -65,9 +65,10 @@ public class JdbcThinPreparedStatement extends JdbcThinStatement implements
Prep
      * @param conn Connection.
      * @param sql SQL query.
      * @param resHoldability Result set holdability.
+     * @param schema Schema name.
      */
-    JdbcThinPreparedStatement(JdbcThinConnection conn, String sql, int resHoldability) {
-        super(conn, resHoldability);
+    JdbcThinPreparedStatement(JdbcThinConnection conn, String sql, int resHoldability, String
schema) {
+        super(conn, resHoldability, schema);
 
         this.sql = sql;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/3c355e9f/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinStatement.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinStatement.java
b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinStatement.java
index 603545b..d29df93 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinStatement.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinStatement.java
@@ -55,6 +55,9 @@ public class JdbcThinStatement implements Statement {
     /** JDBC Connection implementation. */
     protected JdbcThinConnection conn;
 
+    /** Schema name. */
+    private final String schema;
+
     /** Closed flag. */
     private boolean closed;
 
@@ -87,12 +90,14 @@ public class JdbcThinStatement implements Statement {
      *
      * @param conn JDBC connection.
      * @param resHoldability Result set holdability.
+     * @param schema Schema name.
      */
-    JdbcThinStatement(JdbcThinConnection conn, int resHoldability) {
+    JdbcThinStatement(JdbcThinConnection conn, int resHoldability, String schema) {
         assert conn != null;
 
         this.conn = conn;
         this.resHoldability = resHoldability;
+        this.schema = schema;
     }
 
     /** {@inheritDoc} */
@@ -122,7 +127,7 @@ public class JdbcThinStatement implements Statement {
         if (sql == null || sql.isEmpty())
             throw new SQLException("SQL query is empty.");
 
-        JdbcResult res0 = conn.sendRequest(new JdbcQueryExecuteRequest(stmtType, conn.getSchema(),
pageSize,
+        JdbcResult res0 = conn.sendRequest(new JdbcQueryExecuteRequest(stmtType, schema,
pageSize,
             maxRows, sql, args == null ? null : args.toArray(new Object[args.size()])));
 
         assert res0 != null;


Mime
View raw message