Skip to content

Instantly share code, notes, and snippets.

@pietia
Created January 7, 2009 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save pietia/44478 to your computer and use it in GitHub Desktop.
Save pietia/44478 to your computer and use it in GitHub Desktop.
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 = 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