You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by ar...@apache.org on 2015/10/14 23:26:54 UTC

[2/3] incubator-trafodion git commit: Incorrect messages for ResultSet

Incorrect messages for ResultSet


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

Branch: refs/heads/master
Commit: 7a250d09a841e6fdbcded2ddce225890ac4ce269
Parents: 3af9220
Author: Kevin Xu <ka...@esgyn.cn>
Authored: Wed Oct 14 14:48:52 2015 +0800
Committer: Kevin Xu <ka...@esgyn.cn>
Committed: Wed Oct 14 14:48:52 2015 +0800

----------------------------------------------------------------------
 core/conn/jdbc_type4/src/T4Messages.properties                | 7 +++++++
 .../jdbc_type4/src/org/trafodion/jdbc/t4/TrafT4ResultSet.java | 6 ++----
 2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a250d09/core/conn/jdbc_type4/src/T4Messages.properties
----------------------------------------------------------------------
diff --git a/core/conn/jdbc_type4/src/T4Messages.properties b/core/conn/jdbc_type4/src/T4Messages.properties
index 43a9ade..24d6fb1 100644
--- a/core/conn/jdbc_type4/src/T4Messages.properties
+++ b/core/conn/jdbc_type4/src/T4Messages.properties
@@ -677,3 +677,10 @@ numeric_out_of_range_d_msg=Numeric value {0} is out of range [{1}, {2}]
 numeric_out_of_range_d_sqlstate=22003
 numeric_out_of_range_d_sqlcode=29188
 
+cursor_is_before_first_row_msg=The cursor is before the first row, therefore no data can be retrieved
+cursor_is_before_first_row_sqlstate=HY109
+cursor_is_before_first_row_sqlcode=29189
+
+cursor_after_last_row_msg=The cursor is after last row, which could be due to the result set containing no rows, or all rows have been retrieved.
+cursor_after_last_row_sqlstate=HY109
+cursor_after_last_row_sqlcode=29190
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7a250d09/core/conn/jdbc_type4/src/org/trafodion/jdbc/t4/TrafT4ResultSet.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbc_type4/src/org/trafodion/jdbc/t4/TrafT4ResultSet.java b/core/conn/jdbc_type4/src/org/trafodion/jdbc/t4/TrafT4ResultSet.java
index e1f0661..668aea8 100644
--- a/core/conn/jdbc_type4/src/org/trafodion/jdbc/t4/TrafT4ResultSet.java
+++ b/core/conn/jdbc_type4/src/org/trafodion/jdbc/t4/TrafT4ResultSet.java
@@ -4299,12 +4299,10 @@ public class TrafT4ResultSet extends HPT4Handle implements java.sql.ResultSet {
 			return insertRow_;
 		} else {
 			if (isBeforeFirst_) {
-				String cursorExpt = "The cursor is before the first row, therefore no data can be retrieved.";
-				throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), cursorExpt, null);
+				throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "cursor_is_before_first_row", null);
 			}
 			if (isAfterLast_) {
-				String cursorExpt = "The cursor is after last row, which could be due to the result set containing no rows, or all rows have been retrieved.";
-				throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), cursorExpt, null);
+				throw HPT4Messages.createSQLException(connection_.props_, connection_.getLocale(), "cursor_after_last_row", null);
 			}
 			return (BaseRow) cachedRows_.get(currentRow_ - 1);
 		}