[ 
http://issues.apache.org/jira/browse/DERBY-953?page=comments#action_12371482 ] 

Daniel John Debrunner commented on DERBY-953:
---------------------------------------------

I think this is the correct fix, a slightly modified version of the second 
patch, removing the assumption that if
checkExecStatus throws an exception that the statement is closed. This them 
matches the ResultSet.isClosed() approach.

     /**
+     * Tell whether this statment has been closed or not.
+     *
+     * @return <code>true</code> is closed, <code>false</code> otherwise.
+     * @exception SQLException if a database access error occurs.
+     */
+    public boolean isClosed() 
+        throws SQLException {
+        // If active, verify state by consulting parent connection.
+        if (active) {
+            try {
+                checkExecStatus();
+            } catch (SQLException sqle) {
+            }
+        }
+        return !active;
+    }

> Add miscellaneous Statement methods introduced by JDBC 4
> --------------------------------------------------------
>
>          Key: DERBY-953
>          URL: http://issues.apache.org/jira/browse/DERBY-953
>      Project: Derby
>         Type: New Feature
>   Components: JDBC
>     Reporter: Rick Hillegas
>     Assignee: Kristian Waagan
>      Fix For: 10.2.0.0
>  Attachments: DERBY-953-1a.diff, DERBY-953-1a.stat, DERBY-953-2a.diff, 
> DERBY-953-3a.diff
>
> As described in the JDBC 4 spec, sections 13.1 and 3.1.
> This adds support for new Statement methods added by JDBC4 and not addressed 
> by other JIRAs: isClosed() and getResultSetHoldability().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to