db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r391846 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc: EmbedResultSet.java EmbedResultSet40.java
Date Wed, 05 Apr 2006 23:38:01 GMT
Author: djd
Date: Wed Apr  5 16:37:58 2006
New Revision: 391846

URL: http://svn.apache.org/viewcvs?rev=391846&view=rev
Log:
DERBY-1101 Modify EmbedResultSet.getHoldability() so that it uses getActivation() instead
of getStatement().
Contributed by  Knut Anders Hatlen knut.hatlen@sun.com

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet40.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java?rev=391846&r1=391845&r2=391846&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java Wed Apr
 5 16:37:58 2006
@@ -48,6 +48,7 @@
 import org.apache.derby.iapi.services.io.LimitReader;
 import org.apache.derby.iapi.error.ExceptionSeverity;
 import org.apache.derby.iapi.reference.JDBC20Translation;
+import org.apache.derby.iapi.reference.JDBC30Translation;
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.util.StringUtil;
 
@@ -1556,6 +1557,26 @@
 		return rMetaData;
 	  }
 	}
+    
+    /**
+     * JDBC 4.0
+     * 
+     * <p>
+     * Retrieves the holdability for this <code>ResultSet</code>
+     * object.
+     * 
+     * @return either <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code>
+     *         or <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
+     * @exception SQLException
+     *                if a database error occurs
+     */
+    public final int getHoldability() throws SQLException {
+        checkIfClosed("getHoldability");
+        if (theResults.getActivation().getResultSetHoldability()) {
+            return JDBC30Translation.HOLD_CURSORS_OVER_COMMIT;
+        }
+        return JDBC30Translation.CLOSE_CURSORS_AT_COMMIT;
+    }
 
     /**
      * <p>Get the value of a column in the current row as a Java object.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet40.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet40.java?rev=391846&r1=391845&r2=391846&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet40.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet40.java Wed Apr
 5 16:37:58 2006
@@ -60,29 +60,6 @@
         throw Util.notImplemented();
     }
     
-    /**
-     * Retrieves the holdability for this <code>ResultSet</code>
-     * object.
-     *
-     * @return either <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code>
-     * or <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
-     * @exception SQLException if a database error occurs
-     */
-    public final int getHoldability() throws SQLException {
-        checkIfClosed("getHoldability");
-        Statement statement = getStatement();
-        if (statement == null) {
-            // If statement is null, the result set is an internal
-            // result set created by getNewRowSet() or getOldRowSet()
-            // in InternalTriggerExecutionContext. These result sets
-            // are not exposed to the JDBC applications. Returning
-            // CLOSE_CURSORS_AT_COMMIT since the result set will be
-            // closed when the trigger has finished.
-            return CLOSE_CURSORS_AT_COMMIT;
-        }
-        return statement.getResultSetHoldability();
-    }
-    
     public void updateNString(int columnIndex, String nString) throws SQLException {
         throw Util.notImplemented();
     }



Mime
View raw message