-
-
Save myabc/44716 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/do_jdbc/src/java/data_objects/Command.java b/do_jdbc/src/java/data_objects/Command.java | |
index f0ccc00..922db88 100644 | |
--- a/do_jdbc/src/java/data_objects/Command.java | |
+++ b/do_jdbc/src/java/data_objects/Command.java | |
@@ -89,6 +89,9 @@ public class Command extends RubyObject { | |
RubyClass resultClass = Result.createResultClass(runtime, moduleName, errorName, driver); | |
java.sql.Connection conn = (java.sql.Connection) wrapped_jdbc_connection.dataGetStruct(); | |
+ // affectedCount = 1 means 1 updated row | |
+ // or 1 row in result set that represents returned key (insert...returning), | |
+ // other values represents numer of update rows | |
int affectedCount = 0; | |
PreparedStatement sqlStatement = null; | |
java.sql.ResultSet keys = null; | |
@@ -150,6 +153,7 @@ public class Command extends RubyObject { | |
} | |
if (keys != null) { | |
insert_key = unmarshal_id_result(runtime, keys); | |
+ affectedCount = (affectedCount > 0) ? affectedCount : 1; | |
} | |
// not needed as it will be closed in the finally clause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment