trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbirds...@apache.org
Subject [1/2] trafodion git commit: support one more date pattern 'yyyy-MM-dd:.*'
Date Thu, 10 May 2018 19:14:20 GMT
Repository: trafodion
Updated Branches:
  refs/heads/master 65bdd82ab -> 274d0d884


support one more date pattern 'yyyy-MM-dd:.*'


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

Branch: refs/heads/master
Commit: eadd2d546128d66381bcf240615854986cdf9d4d
Parents: 371b7e5
Author: Kevin Xu <kaihua.xu@esgyn.cn>
Authored: Wed May 9 11:41:14 2018 +0800
Committer: Kevin Xu <kaihua.xu@esgyn.cn>
Committed: Wed May 9 11:41:14 2018 +0800

----------------------------------------------------------------------
 .../main/java/org/trafodion/jdbc/t4/InterfaceStatement.java | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/eadd2d54/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceStatement.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceStatement.java
b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceStatement.java
index 7b42ed1..f5958de 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceStatement.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/InterfaceStatement.java
@@ -287,9 +287,14 @@ class InterfaceStatement {
 				}
 				break;
 			case InterfaceResultSet.SQLDTCODE_TIMESTAMP:
-				Timestamp tmpts;
+				Timestamp tmpts = null;
 				try {
-					tmpts = Timestamp.valueOf((String) paramValue);
+					String tmpStr = (String) paramValue;
+					String pattern = "(\\d{4}-\\d{1,2}-\\d{1,2}):(.*)";
+					if(tmpStr != null && tmpStr.matches(pattern)) {
+						tmpStr = tmpStr.replaceFirst(pattern, "$1 $2");
+					}
+					tmpts = Timestamp.valueOf(tmpStr);
 				} catch (IllegalArgumentException iex) {
 					throw TrafT4Messages.createSQLException(pstmt.connection_.props_, locale, "invalid_parameter_value",
 							"Timestamp data format is incorrect for column: " + paramNumber + " = " + paramValue);


Mime
View raw message