Repository: trafodion
Updated Branches:
  refs/heads/master ed83389c3 -> e30699db8


TRAFODION-2905 query id contain null


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

Branch: refs/heads/master
Commit: b6c7df53cd8f60eeebd3617bb34f338aa1106a82
Parents: 33325b6
Author: aven <shengchen...@esgyn.cn>
Authored: Thu Jan 11 19:06:25 2018 +0800
Committer: aven <shengchen...@esgyn.cn>
Committed: Thu Jan 11 19:06:25 2018 +0800

----------------------------------------------------------------------
 .../main/java/org/trafodion/jdbc/t4/TrafT4Connection.java   | 9 ++++++---
 .../src/main/java/org/trafodion/ci/DatabaseQuery.java       | 1 +
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/b6c7df53/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Connection.java
----------------------------------------------------------------------
diff --git 
a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Connection.java 
b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Connection.java
index 876e831..ce7c980 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Connection.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4Connection.java
@@ -541,7 +541,7 @@ public class TrafT4Connection extends 
PreparedStatementManager implements java.s
                        stmtLabel = stmtLabel.toUpperCase();
                }
 
-               TrafT4CallableStatement stmt;
+               TrafT4CallableStatement stmt = null;
 
                clearWarnings();
                if (_isClosed() == true) {
@@ -557,8 +557,11 @@ public class TrafT4Connection extends 
PreparedStatementManager implements java.s
                                        return stmt;
                                }
                        }
-
-                       stmt = new TrafT4CallableStatement(this, sql, 
stmtLabel);
+            if (stmtLabel.equalsIgnoreCase("null")) {
+                stmt = new TrafT4CallableStatement(this, sql);
+            } else {
+                stmt = new TrafT4CallableStatement(this, sql, stmtLabel);
+            }
                        stmt.prepareCall(stmt.sql_, stmt.queryTimeout_, 
stmt.resultSetHoldability_);
 
                        if (isStatementCachingEnabled()) {

http://git-wip-us.apache.org/repos/asf/trafodion/blob/b6c7df53/core/conn/trafci/src/main/java/org/trafodion/ci/DatabaseQuery.java
----------------------------------------------------------------------
diff --git a/core/conn/trafci/src/main/java/org/trafodion/ci/DatabaseQuery.java 
b/core/conn/trafci/src/main/java/org/trafodion/ci/DatabaseQuery.java
index c3bb9f3..b6240d3 100644
--- a/core/conn/trafci/src/main/java/org/trafodion/ci/DatabaseQuery.java
+++ b/core/conn/trafci/src/main/java/org/trafodion/ci/DatabaseQuery.java
@@ -661,6 +661,7 @@ public class DatabaseQuery extends QueryWrapper
       
       try
       {
+         // here if stmtName = null, then it will pass a "null" string, this 
will skip driver's conditional judgment (if (stmtName ==null) throw exception).
          cStmt = ((TrafT4Connection)conn).prepareCall(queryStr,"\"" + stmtName 
+ "\"");
       } catch (NoSuchMethodError nsme)
       {

Reply via email to